Yes, and apps brings more customers to buy iPhones.
That's the incentive loop that exists with computers. Anyone can build a Mac app and sell it online without going through App Store, nor pay some fee per install to Apple. If all developers withdrew from Mac, no one would buy them no matter how good the performance is.
Somehow, Apple fooled everyone into thinking that it's now OK to pay a fee per install on mobiles.
Apple IS getting paid by customers choosing to buy iPhones and pay for the online services from Apple like iCloud, etc.