I suppose that could be one of the reasons, but I believe the main reason was google won over CS students in high school and college in the late 90s and early 00s. I was introduced to google in high school because it was the best search engine for looking up programming code for my CS classes. Better than altavista, excite, etc. And naturally the word spread, not to mention the people maintaining computers, labs, etc all set google as the default search engine.
Sadly, now google is a terrible mess of moderated and curated nonsense.
I think Google got its big break when yahoo used them and allowed Google to put a 'powered by Google' button. I clicked it and never stopped using google
IT was responsible for setting thousands of machines default pages to Google through all our system images from an IT Desktop support perspective - this was because Yahoo's frontpage was an utter hideous mess - and it was the minimalistic portal to the internet that worked way better for the users in the companies I worked at then.
Yahoo advertising for Google on their front page is almost similar to another such rare extremely lucky break when IBM advertised for Microsoft in its all glory. Behind every billion dollar company there is an event that had one in billion chance of happening.
Absolutely that helped in gaining a wider audience. But I suspect the reason yahoo chose google was because all their tech people preferred google because they all used it to search for code. Maybe it's my high school or my college, but google won over the CS crowd very quickly. Their clean interface and their ability to get the code we were searching for to help us with our homework really gave them a leg up.
Then their gmail ( especially the initial invite and storage ) and chrome made google the "cool" tech company and pretty much cemented their place in the tech world. Sadly, they've turned out to be monsters rather than saints and we are all the worse off for it.
I'm not happy about everything Google does, but I don't actually feel worse off. I use their search dozens of times a day, I rely on GMail and Google Maps, Google Docs is fantastic. It's hard sell to convince me that I am worse off due to the existence and my use of Google products.
Sadly, now google is a terrible mess of moderated and curated nonsense.