"It boggles my mind that Apple isn't using all these money for something better. What prevents them from, say, hiring up or luring away all the great CS/hardware PhDs, build a giant lab for robotics, build new space exploration company, new sustainable for-profit tech company, start massive search engine efforts, start giant initiative for for-profit cancer research and so on and on and on."
And what do you think Apple is exactly doing?
My company have worked for them in the industrial side and let me tell you this strait: Apple could afford what nobody does, and they do.
You have never wondered why Apple is the one along three manufacturers(Samsung and Microsoft) that could create aluminum computers and not cheap plastic ones?.
The answer is billions invested in manufacturing plants. Apple always gets the best electronic components first because of being, for example, the biggest user of lithium batteries in the world(and the electronics that control it). They have a tremendous negotiation power and routinely screws one or two turns over manufacturers because they can.
Apple designs their own hardware at chip level, they are working on cars, like Google.
They park their money in debt instruments while doing the above like any other company does for getting liquidity.
"Apple can really put the world 50 years ahead in tech if they chose to invest the money in these areas."
I don't believe you understand the meaning of diminishing returns.
If you have more sex with a woman you don't have kids faster than 9 months.
When Microsoft competed against mosaic browser, Mosaic had like 20 employees or so, Netscape like 100, and Microsoft used like 2000. Microsoft browser did not get 20 times faster than Netscape.