First of all, I want to emphasize that I don't know much about the technical side of computers, nor do I work in the industry, so everything I'm saying in this post is just my (very humble) opinion, even if my writing style doesn't corroborate that.
I used to think that Apple merely charged a premium for standard parts. Maybe they did at first, but as friends and people who generally agreed with me began to try Apple products and like them, I was forced to reconsider my stance. In the last 2 years or so I've bought an ipad and an iphone and have used a variety of Apple products and have changed my opinion. I should mention that it's often been other company's failings rather than apples perks that have led me to chose Apple over other alternatives. For example I had an HTC desire which I purchased on release on a 2 year contract. It wouldn't update past android version 2.2, and 18 months into the contract I was over 2 full versions of android behind, meaning I couldn't get lots of newly released apps etc. I've loved my iphone because it's worked how it was supposed to. The only time I had a problem with it is when the on button broke, and apple gave me a brand new phone within 2 days. I can put up with the pretentious store layout and "genius" workers for that level of customer service. My ipad I've found less useful, but after having owned it for 2 years I've come to the conclusion that I'd have the same issues with any tablet; i.e. I don't know what to use it for apart from watching tv shows in bed. I originally bought it for use in lectures, but I found that I can't do anything productive on tablets due to the lack of keyboard + mouse, the touch screen is generally awful for playing games, and browsing while possible I still find a pain in the ass, because I like to have 5+ tabs open and switch between them quickly.
There a few reasons why I think people opt for Apple over other companies. It's basically mandatory these days to own a phone and a computer of some sort. You can't function properly without e-mails, access to the internet, and in most people's case word processing. Not everybody has the time/mind to learn the ins and outs of how their computer works. Apple does the best job of minimizing the knowledge the user needs in order to operate their computer the way they'd like. Most people with any decent experience of using windows would argue that windows isn't hard to use either, but I think they underestimate how bad some people can be with computers. Some people have no intuition of how toolbars work, no knowledge of where their programs install to, what the difference between a shortcut and the actual file is e.t.c. And this kind of knowledge is required as soon as something doesn't install properly (for example, the question "do I download the 64bit version or the 32 bit version" will leave most people stumped). Combine this lack of knowledge with an inability to use Google properly, and you have a helpless user, who now dislikes Windows.
It's been said that people only have trouble with windows because they aren't willing to commit to learning how a PC works and that could be true but that doesn't change their attitude. There's a good analogy in the early car industry. When cars first became available to the average person, it took a lot of knowledge about engines and the workings of a car in general to keep them up and running. Each person would basically be the mechanic of their own car. Nowadays you don't need to know how a car works in order to use one, and if something does go wrong you take it to an expert. Apple is doing the same with computers. There is the attention that Apple pays to design. Aesthetics matter to most people, even if they're not the most important influence on one's decision of what to buy. For example, the portability/power ratio of the new macbooks is unrivaled. They manage to fit decent components inside a very small shell, while maintaining good looks and low weight. It feels like other companies are playing catch-up as far as laptops are concerned. Apple seems to be the first company to systematically consider real-world factors such as portability/power, aesthetics, battery life and ease of use, and come up with a product that comes close to maximizing these considerations in the frame of current technology.
Apple's marketing is miles ahead of its rival companies; they don't explicitly tell you that their products are superior, the advertising makes you think you came to the conclusion yourself after careful consideration. They stick to their minimalist grey/white theme which has become their signature style; you could recognize a new apple product at a glance even without the logo. The naming system of their products also helps; for example every new iteration of the ipad is just called the ipad, so that it feels as though they only have one product per category (i.e. one tablet, one laptop, one phone...). There are a lot of phones on the market at the moment and it's hard to be across the pros and cons of every model. When other companies are releasing 2 or 3 products for every 1 that apple release, all with different names and purposes, it gives the impression that they're firing from the hip while apple line up their shot and hit the center. The lack of direct competition apple has is disappointing; they have their own operating system and manufacture products to work with it, and every apple product interacts with the others so that once the consumer has invested in one apple product, they are more likely to invest in another. When I walk around my university campus 75% of the laptops and tablets, and maybe 50% of the phones I see are apple. Even ignoring everything I've said so far, one has to admit that for whatever reason, apple has a grasp on the market. It's almost feels like living in a communist state when everyone you see has the same model of gadget. This is a major put off for me, I don't like dependency on one brand, and I enjoy variety.
I think the reason apple doesn't dominate on the desktop front is that form factor matters much less. Even the most materialistic people realize that you don't need a lightweight, portable desktop, nor do you particularly want a pretty one; it spends its entire lifetime under a desk not being looked at. Still a number of them are sold due to commitment to the brand, and relative simplicity of the operating system. I built my own windows desktop and prefer it over any mac I've used, mainly due to the customization you can have with self built pc in conjunction with windows. There are still a lot of programs and games that work best/only work with windows.