For Apple it could just be a customer acquisition cost.
It could also just be sold as a service, or an addition to iCloud+.
If there is an opportunity to increase revenue (subject to mission/values/etc), you take it. A decrease in another line of business doesn’t matter. Or an increase; you wouldn’t say “hey we’ve got this amazing ad opportunity but the AirPods business is killing it so let’s not bother.”
I guess the nuance here is that the business decision might be “our search, with our ads” versus “Google’s search, with their ads, plus $15B/year”. In that case I think there’s a reasonable argument that users are better off with Apple’s ads than Google’s.