Don't have a chat app? Buy one. Don't have machine learning yet? Buy a couple of those too.
Even if a company like Google lost most of it's income overnight, it could coast for years on pure cash reserves. The amount of money these big tech behemoths have to work with is incredible. As long as they strike gold once or twice every several years, they'll be fine.