With the iPod, iPhone and iPad, Apple have been going from Early Mover to Early Mover, which has allowed them to keep their high margins. Unless they can keep finding even more new markets to move into, they are going to find it harder and harder to maintain high margins. They will then almost certainly have to lower their prices to remain competitive, or lose huge amounts of market share.
tl:dr digital content delivery made Apple king.
OSX has Unix compatibility, better audio and video production etc.
Neither is "simply better".
I was a Mac user through that time. Windows 95 came around with preemptive multi-tasking. The Mac was still more polished, but Windows 95 was a better operating system. This period also saw Intel processors far outpace the PowerPC. When OS X came out in 2001, it was so slow as to be nearly unusable. 10.1 helped, but comparing it to a Windows XP machine was simply disheartening.
Looking back on this period, I find it hard to believe that I (mostly) stuck with the Mac platform through it. OS X is wonderful today. However, I think it's important to realize that during the dark days for Apple, they were really selling inferior machines and an inferior operating system. From 1995-2001, Apple was selling a cooperatively multitasked operating system against a more technologically sound Windows 95/98. Intel processors were very significantly better as OS X came around and Apple was having trouble getting good PowerPC processors out of IBM and Motorola. Apple introduced a 700MHz iMac in 2002 against around 2GHz PCs. Apple did try to spin it and we all know that MHz isn't everything, but there was quite a gap - a gap that would simply become larger until the Intel switch.
So, it's easy to say that "Windows machines competed on price," but I think looking at the history, Windows machines were substantially better for a decade. Mac OS was still better polished and a more pleasant interface (in my opinion), but the classic Mac OS was ancient by the technology of the day, OS X was dreadfully slow when introduced, and Intel processors wiped the floor with PowerPCs. The Windows machines weren't just "competing on price", but were better.
While people may prefer Android or Windows phones, the iPhone's processor is as fast or faster than what is being offered in the competition. You may want a different mix of features than iOS offers, but I don't think a reasonable person would say that it's technologically inferior to its competitors. In many ways, Apple is still the state of the art. The A6 processor runs circles around the Galaxy S III (http://www.anandtech.com/show/6330/the-iphone-5-review/10), iOS is well liked, the build quality of Apple's devices is arguably the best in the industry, etc. Apple does have competitors and it would be foolish to discount them. However, Apple's current situation is absolutely nothing like 1995-2006. In that period, a dispassionate person would look at Apple's products and find them woefully inadequate. Today, dispassionate people don't find Apple's products lacking.
At the time I thought that the lack of quality of the Mac was an offshoot from the lack of market share, but having read a number of books lately on that era, I think it was more a lack of Steve Jobs that was the problem.
It will be interesting to see what happens now, because again they don't have Jobs, but the current team are in my opinion far more on top of things than the management team in the 90's. OSX is also on a much firmer footing than the old Mac OS, particularly because of the Unix roots.
iOS I'm not sure about. I think they have made a number of compromises and sacrifices in order to make the phone run quicker and be more "simple", but I think it is falling behind Android. I also think that their reliance on marketing Retina DPI along with having s fixed resolution is getting them into trouble.
Then, as now, Windows primarily thrived because corporate buyers bought more of what they already had. The success of Windows between 1996-2005 was almost entirely due to monopolistic abuse and buyer inertia.
Windows machines thrived for many reasons, including being faster, cheaper, having the best office programs, by far the best games, as well as all the advantages they had in enterprise.
I don't think any competent observer could say that late 90's Macs were good value machines.