Also, I guess if things are sold out often then they're more rare and people have more reason to want them or collect them / makes them more popular?
Quite correct. Having limited amount of stock for items increases the rarity which also increases the price of it.