Google already has a trackrecord of beating Microsoft. Do you remember Windows Phone? Well Google made Android in response to Windows Phone + Bing threat not in response to iPhone.
Well, Steve Ballmer wasn't exactly an innovator - just kept milking the cash cow.
Satya Nadella seems way more tuned into the zeitgeist. His heavy bet on OpenAI may seem excessive, but at worst it's going to be cheap insurance and at best may be a game changer.
I think Google's producing Android was a reaction to BOTH iPhone and Windows Phone - they didn't want to be frozen out of the mobile advertizing market by competitors that owned the platforms.
Windows Phone launched in late 2010, long after Android. Do you mean Windows CE / Windows Mobile? But if so, those weren't really a serious threat to anyone.