They build a wildly successful cloud platform, they’re expanding their subscription services, they’ve got enterprise offerings, etc
The trick is that Google accepted that none of their other business would likely have the margins and volume that search has, but they did it anyways.