Apple's proprietary OS and iOS give it sustained product differentiation, as noted by Ben Thompson at stratechery.com. It's very difficult if not impossible to copy an operating system due to its complexity (despite other companies, like Samsung and Xiaomi, copying Apple's UI style). Michael Porter's four generic strategies are: differentiated and targeting a broad market; differentiated and targeting a niche market; low cost and targeting a broad market; and low cost and targeting a niche market. See Concepts page and discussion of Michael Porter.
Competitors typically don't want to get stuck in the middle, selling an undifferentiated product that's not low cost to the middle of the market. That's because they lose business to: (1) low cost, undifferentiated competitors who can beat them on price; and (2) high end, differentiated competitors who can beat them on quality, service, and product features.
But what Apple seems to do is take the high end market and then take the mid-market. And it can comfortably do this because it has sustained differentiation through OS and iOS. This differentiation means that low cost competitors can't compete with Apple based solely on price. So Apple can put a mid-market ceiling on low cost competitors by dropping price, selling both mid-market and high end products (and letting low cost, low margin competitors put each other out of business through price-based competition).
And Apple is already at the differentiated high end, so other high end competitors are a de minimis threat if Apple also decides to offer differentiated, mid-market products.
The author owns stock shares of Apple.