Apple made a decision early on to "give away" the ability to write and distribute (the $100 fee is nothing) apps for their store, and only take payment from payment received. So you have tons of free apps that just exist on Apple's code and infrastructure, with no cost to the companies.