Many users will type, for example, "facebook" into their address bar. The browser searches Google, and whoever bought the ads will be on top.
Facebook can't allow any other company to come up first, and so they pay.
Many, many ad clicks work this way, and I consider it to be a dark pattern at best, but similar to fraud at worst.