In the 90s, Apple's OS was a hot mess because their attempts to create a new, modern OS to replace it finally fell through.
In 2001, Apple replaced their aged, kludge-ridden 1984 operating system (MacOS 9) with a completely new, Unix-like system (OS X) designed from the ground up as a secure multi-user/multi-tasking/networked OS and which had started life a few years earlier as a server-only OS. There was a change-over period, during which OS X went through several versions, but Apple managed a pretty much complete transition in a couple of years, after which "legacy" software was completely dumped in favour of modern, substantially re-written code.
In 2001, Microsoft replaced their aged, kludge-ridden <i>1970s</i> (still recognisably based on CP/M) operating system (Windows 95/98/ME) with a new system (Windows NT/2000/XP), written by the designers of VAX VMS and designed from the ground up as a secure multi-user/multi-tasking/networked OS and which had started life a few years earlier as a server/workstation-only OS. <i>However, it was hamstrung by the PC communities pathological need to retain full compatibility with every bit of DOS/Windows software ever written (or still being developed by teams with tools & skills 20 years out of date)</i>. This meant, to pick one example, that many applications <i>had</i> to run in "Administrator" mode (because that's all there was on DOS/Win9x) and the Mac solution of requesting an admin password before each and every privileged action was unworkable (or just trained users to keep entering their password without question).
Then, in 2007, this hot mess got even hotter and messier because the next major release of Windows (Vista) was a much-derided train wreck. Windows 7 was OK, but then history repeated itself and Win 8 was a laughing stock. Win 10 seems to be solid on new hardware - its just the upgrade process that was bungled.
Windows probably "caught up" with OS X around Windows 7, but MS has still been having a hard time stamping out the older stuff. Bottom line: Its taken Microsoft 10+ years to drag their users into the 21st century, Apple achieved that over a couple of years.
(But, yes, the ubiquity of Windows is also a reason).