I believe once I saw a shop's content updated while I had the trading interface open (at least the game started to terribly lag and almost froze and after that I imagine that I could see articles which have not been there before). So, my guess would be time.
There can be changes based on which character talks to the merchant. I don't know what mechanism is suppose to trigger an update, though (didn't check enough to notice a pattern).