I’ve made a good living for ~8 years writing free (as in “Get” on App Store) apps.
One required a subscription, paid via separate website.
One funded by in-content advertising (not linked, just there).
One paid by service provider, enhancing their service.
Apple got $99/year, which is practically nothing for hosting distribution, push notification, security certificates, etc for millions of users.
The Apple walled garden is...a walled garden. You buy into a space with rules, which work very well for most who work with those rules. You can provide your own billing, advertising, etc without paying Apple more than a paltry $99/yr fee for a bargain in services.