The dev market for laptops is X. The random Joe Sixpack market for iToys is 100x or 1000x. If they are going to invest some giant figure in development, it will be for Joe Sixpack toys and not the best OS to ever live.
(That is if throwing money at the problem would actually make a better OS. I suspect Microsoft throws more money at OS than all the other OS companies combined. They still have some massive failures).
Similarly for Mac OS. The main alternatives to watering down experience of their developers or power users are a scheming competitor with history of screwing its own ecosystem up arbitrarily and Linux distros that are lame compared to Mac/UNIX experience. I say that as an Ubuntu user.
If they want their own fabs and phones, it seems fitting to also ensure their desktop experience for developers or power users is similarly low risk or tuned to their needs. Redmond and Linux surely aren't.
To put it another way: all they do is tactics - not strategy.
They also have differentiators of usability, cool factor, UNIX support & privacy given Microsoft's turn with recent Windows. There's also a software ecosystem to further monetize & develop. Apple is screwing up big time in letting Mac OS languish.