Well to compare Apples to Apples we would need to know how much money Apple has spent with many of those efforts, which before Jobs came back almost driven the company to bankruptcy.
For younger generations Apple might feel unstoppable, meanwhile I remember the discussions to migrate away from surviving Macs on our IT department, and my graduation thesis was porting a particle simulation engine from NeXTSTEP into Windows, as those boxes were to be sent away.
We don't have to wonder with Microsoft. Again and again they have paid billions of dollars for complete failures like the Surface RT and Windows RT. They would have been well advised to cancel the platform before spending a fortune on advertising and unsold inventory.
Hell, how much did they pay for Skype, despite already having several text and video chat clients of their own? Then they completely rewrote Skype before replacing it with Teams.
They have a longstanding habit of taking shareholder value and creating huge bonfires from it.
For younger generations Apple might feel unstoppable, meanwhile I remember the discussions to migrate away from surviving Macs on our IT department, and my graduation thesis was porting a particle simulation engine from NeXTSTEP into Windows, as those boxes were to be sent away.