What does hosting an app have to do with giving Apple 30% of digital purchases?
Access to Apple's lucrative customer base, just as any store marks up products. Maybe Apple should have simply done that, let the developer decide a price and simply add a markup instead of setting it as a fee. The developer gets what they want and Apple gets theirs.
The vast majority of apps on the App Store are free to download and don’t require IAP to use.
Apple has decided free apps need not pay to be in the App Store, which is their perogative. If an app makes more than a set amount, Apple collects 30%, 15% for apps that make less than a set amount.