For an example in the opposite direction look at Amazon. Amazon spends practically every penny of excess on expanding. This brings their on-paper earnings down to laughably low levels and nets them a seemingly absurd P/E ratio. Amazon is projected to overtake Apple as biggest tech firm.
Seems to me that sitting on cash is a dumb medium-long term strategy, and companies which do it will eventually be out-competed by those which don't.
Don't be so sure. As of last year, Apple was sitting on a quarter of a TRILLION dollars in the bank.