How do manufacturers know how much to make?

So I saw today that the generation one monster high dolls are being re-released and it made me wonder. how do manufacturers/companies know how much to make/order? like I can only assume these dolls will only be available for a limited time, do they just keep making them until that time runs out or?