Each merchant has a limited stock (restocked every morning) and a limited till (topped up every morning): they can’t buy everything. What you sell them joins their stock.
Aubin’s Market Hall (on the square): consignment between players. You leave a lot (up to 64 identical items) with its price, at least what a merchant would pay. It stays for sale until another player buys it, even if you are offline; the gold comes straight to you, minus a 5% commission. At most ten lots per player; damaged items and ingot shop items cannot be sold there.
A merchant buys back at half price. Charisma and the Silver tongue talent do a little better; the Haggling talent lowers purchase prices.