The web/webapps/mobile helped lead to this era of "desktop PCs" (to include laptops) where the browser mattered more than the OS. It allowed Apple to become resurgent in the desktop market because OS compatibility mattered less than ever. It's not weird that it led to Apple regaining _some_ market share because clearly there was demand for the Apple/MacOS/OS X experience that may have been tempered by incompatibility…
In the PowerPC era the software was fantastic, especially when you factor in the much lower odds of viruses and malware. However, the hardware was well behind the curve except right at the release of a new generations, which were few and far in between.
Then when Apple switched to Intel, you had a few years of incredible hardware and incredible software. This is when the Mac absolutely blew up.
But then while Apple has constantly been improving the hardware (although they’ve made repairabiltu and extensibility worse), their software has seen a steady decline.
Where Apple has been really lucky is that while their software has seen a steady decline, their primary competitor MS’s software has seen several steep declines.