1. They own Android, so as the default search engine on the majority of the world's phones they are privy to insane amounts of data. They also know tons of other things that only being in control of the largest OS provides, like location history and app history.
2. Similarly, with their purchase of DoubleClick 15ish years ago they own the largest ad network.
3. With Gmail they probably know as much about social connections as Facebook.
4. They de facto control AMP, and can thus dictate site implementation to millions of publishers.
All of this info is used by Google to constantly improve their search engine, and it has all the hallmarks of using information from disparate areas (mainly of businesses they acquired, mind you) to build a deeper moat.
The other evil stuff they did, like blackmailing PC makers to ban competing OSes, didn't even get them in much trouble.
There's a bit of a difference between controlling the OS, which was (largely still is) almost impossible for the average user to safely change even if they wanted to, and controlling a web page that anyone who can type 20 characters can switch away from.