Apple did something similar when they switched from Classic Mac OS to Mac OS X - a transition which helped them stay alive and eventually bounce back when almost every one had given up on them. The transition indirectly led them the ultimate success of iOS and iPhone.
Microsoft was left behind in the smartphone race because they were late to the transition — the smartphone revolution started when they were still going through it and they were caught empty handed. They had nothing to show when they desperately needed an OS for smartphones. Had they launched the equivalent of Windows Phone 8 in 2009 or 2010, the history may have been very different from the one we know.
But the world has come full cycle, while the Microsoft Windows ecosystem is still relatively young and can probably keep going for another decade or two, Apple’s OS is starting to show its age. It’s not just the age of macOS — it is much older then that. Apple finally decided to overhaul their filesystem, but other things like the kernel, the API etc. still need the treatment.