Every large tech company has very diverse interests. I mean even Microsoft doesn't just make Windows, they bought minecraft. They all know that technology changes quickly and tech companies can die overnight. Most don't even do what they started as - IBM doesn't make punch card tabulating machines, apple makes phones now, and Google does tons of stuff other than search. Imagine if Adblock became ubiquitous, Google's advertising business would be fucked. But many of their investments could adapt and live on.
I makes perfect sense for Google to invest in robotics. They are already heavily invested in AI which will benefit robotics immensely. And with the coming robotics revolution, whatever companies get in early stand to make billions.