Why does Google need hardware?

Shira Ovide, Bloomberg:

In 2017 and the first half of this year, Google shipped about 5 million Pixel smartphones worldwide, according to the research firm IDC. Apple Inc. sells as many iPhones in about eight days as Google did in 18 months — and even Apple has a relatively small minority market share in smartphones.

And:

Small numbers aren’t confined to Google, either. Journalists like me can’t stop talking about the “runaway success” of the Echo devices, Amazon.com Inc.’s rapidly expanding lineup of voice-activated home doodads. Amazon sold about 3.6 million of the two most popular Echo models from April to June, Strategy Analytics estimated. Fitbit, a company that journalists like me stopped talking about long ago, sold 2.7 million motion-tracking gadgets in the same period.

And:

For most software or internet tech empires, hardware is a niche hobby, and it will remain so for the foreseeable future.

It take a lot of R&D dollars, fragmentation of company focus, to design, test, build, and ship a hardware product. Why does Google do it? Interesting question.