A different look may be like this: I made an app and I gladly give away 30% (it can be less, btw) for not having to care about setting up and supporting payment, distribution and updates infrastructure, dealing with PCI and chargebacks, etc.
The fact that iOS and Android are the only smartphone OSes did force you to do that.
Unless you mean that you could have made a competitor, but that's inane -- that's a completely different market, with huge barrier to entry.
Apple is using its huge market position in one area (smartphone OSes) to give itself a huge advantage in another (music apps). That's the sort of thing companies have got huge fines for in the past, or were broken in parts for.
Aside from setting up payment, all of those issue are still present with Apple / Google payments. The difference is 3% (MC, Stripe, Visa) vs 30% (Apple, Google). That 27% can easily cover those issues and far, far more.
In fact, it's worse. Payment & fraud disputes are also bound to the marketplace. What are the chances that app devs will end up being the ones eating big losses just to continue to exist?