Clearly Microsoft had no dearth of talent or money. So how come it could not keep Google at bay? In my view the answer lies in the fact that Google's engineering led culture meant they could follow a release cadence that is unheard of for such large systems. Chrome was releasing every 6 weeks, and Android every 3-6 months or so in the early days. Meanwhile we had 1.5 - 2 years between each Windows Phone release.
When Chrome started, IE had nearly 70% market share and the benefit of being deployed on nearly every computer on earth. Microsoft was in the mobile phone market from 2000. In 2011, IDC predicted Windows Phone would overtake the iPhone. Both Google and Microsoft were taken aback by the iPhone, but Google was able to turn on a dime, Microsoft was not. Google achievement has been to stay agile even as it grew big - in my view this remains the secret to their success.