Where else would the Android handset makers go, Microsoft?
Actually that sounds good, we could do with a third viable handset OS, but that's a digression and at this point a bit of a fantasy. They have nowhere else to go.
Back in the early days of iOS and Android the consensus seemed to be that the smartphone OSes were pretty much done. To compete with iOS all you had to do was match it's features, or catch up, and once you had it was pretty much all over. Since then Apple and Google have constantly found compelling new features for the OSes almost every year. Apple is sinking billions into the development of iOS, just look at what they're doing just in the area of health[1], and there is clear blue water in terms of quality and features[2] between it and Android, and that gap is increasing.
Google makes most of it's money in mobile off the iOS platform, yet is investing hugely in Android development and making a pittance out of it. Not only is that unsustainable, but if they really want to compete with Apple they need to dramatically increase their investment in Android. They only way they can justify doing that is to actually start making significant revenue off Android. The only way to do that is to sell their own handsets, differentiate them from competing Android handset vendors, command a decent profit margin and grab significant market share.
[1] https://www.cultofmac.com/316559/abc-news-goes-inside-apples...
[2] Super robust and secure XPC; Superior power management; Custom development tools, languages and hardware-software integration with things like Metal and the motion co-processor; High quality health and fitness tracking; VRKit; Highly consistent calibration of sensors between devices, vital for precision applications like VR; All this is arguable in the details, sure, but the fact that Apple is spending hugely on this backed by blockbuster revenues isn't and Google can't realistically match that just for the heck of it. They need a revenue stream to back it up.