Not sure if "all they do is waste investors' money" is an accurate characterisation for the tech giants.
For small start-ups is holds true that most will fail, and waste their investors' money, while the one-in-10 hit is the reason why investors / VCs still pour money into companies that are most likely doomed to fail. But in the case of for example Google, it's 1 company funding many projects, so while most projects will fail, the net cash position of the company will improve thanks to the 1 thing that IS a hit.
One other thing is that while an independent business can go bankrupt because it's product weren't what consumers liked/would pay for, they might still have had some interesting technology that might be wasted, or will at lest take some time to be 'recycled' and reused in a more profitable application. With a bigger company, any useful technology developed can be much more quickly applied to more profitable areas, whether the original application was profitable or not.
And that is exactly why Google etc sit on giant piles of cash.