Your stylized example is unrelated to reality. Users cannot subscribe to Spotify in app, so Apple makes no money
And what do you think the reason for that is?
while providing all the R&D they use to play audio on the device for free
Simply absurd logic. The device owner paid for their device and the OS. Apple already got their cash bag for it.