the original business model was, if I'm not mistaken, licensing the search technology.
Then they found that showing ads with the search results made them a lot more money.
They started optimizing for money made from ads, which depends on user data - letting advertisers show ads to targeted customers.