Apple turned around by moving much more heavily into consumer hardware, specifically the iPod and then the iPhone and iPad. It was not really a software turnaround, though that was a smaller part of it.
I remember in the mid aughts, when I had been working exclusively with linux for some time, I started to see my peers, peers who wouldn't be caught dead with a windows laptop, carrying around os-x laptops.
Compared to the ThinkPad of the day, the macbooks were terrible pieces of hardware; they were obviously designed by people who believed in style over substance, and their keyboard was mush. But... OS-X? OS-X mostly worked, something that could not be said for windows or linux laptops, not without a whole lot of effort.
The turn around happened before.