Google and Apple are definitely charging for that software development. In the case of Apple, it is being folded into hardware prices or used as a loss leader for pricy subscriptions / apps.
Google is also making a buck on subscriptions / apps, but instead of hardware, they’re also making money from licensing software to 3rd party Android manufacturers, and because Google gonna Google, they want that ad revenue.
And I would also argue that a lot of Linux distros make money from professional services and what not.
Most of the big boys aren’t doing the work for free