Google still does search, but it's business has nothing to do with search directly.
If I could aquire either Google's search business, or their ad business, I would take search, no question. The ad part could be rebuilt on search, but the opposite is not true.
You don't want Google's search technology because it will make you money. You want it because it has brand value and lots and lots of users that you want to leverage to make money using some other business.
Walmart's business is selling merchandise. The fact that they have to be experts at building construction so they can make stores to sell merchandise is just as secondary as Google's search business.
Would you rather have Walmart or their real estate?
The company has an advantage, and it's using it to help sell something. Of course if they didn't have adwords, I'm sure Google could have found other ways to make money from their search.
Google is one of these less common start-ups who started doing one thing and ended up successful (to this day) with that specific idea. Yes, they extended their reach a lot, but the core is still the same as on the first day.