Now
What should Apple have done 20-25 years' ago?
The macs that came out in the late 80's and early 90's were all overpriced. Apple could have surely increased her market share with cheaper macs. However, in relation to PCs the low end macs (LCs and Performas) in the mid-90's weren't especially expensive and were quite popular.
Apple divided people then as they do now. I remember university students have clear preferences as to the macs and PCs. Both were available. Both had the same software installed. There were some faculty differences — the PCs in architecture went almost unused as did the macs in the business school.
Apple went mad with product diversication from the mid-90s onwards and also seemed to lose its focus with the plethora of new products (Newtons, QuickTakes and so on) . It lost out with Windows 95 or rather the competition was beginning to catch up then.
Another factor was the role of the Killer App. Apple had its cute OS, PhotoShop and PageMaker (and Quark and friends) up to the mid-90's and these made Macs very popular then. In the mid-90s the first First-Person-Shooters started appearing and they were released initially for DOS. Doom, Quake, Unreal would follow and with the introduction of Windows 95, the PCs had their own Killer Apps and mac sales suffered as a consequence. I switched from macs to PCs on account of games — Half Life, in particular.
So, back to the question — What should Apple do? licence iOS to third parties as they were encouraged to do back in the early 90s? That almost killed them when they did it with System 7.
Develop a plethora of barely indistinguishable products? That didn't help them either.
Apple occupies the upper end of the market. They can't stay as they are and be all things to all people. Competition and diversity eventually kick in. Besides the upper end of the market is a nice place to be, as they long as they don't annoy their current users and drive them away.