Apps not recovering?

Hey All,
I've been playing around with custom ROMs and sometimes when I install something, the only apps that show up in the Market are the ones I've paid for. This would leave me with the process of manually installing all the free apps. Other times, it shows all the apps I should have and automatically downloads them. It then gives me a notification saying "x applications have been recovered". Any ideas why sometimes it does and sometimes it doesn't do that?