They bought Nokia, and had a presence in every Att/Verizon/Sprint/T-Mobile store.
Microsoft tried hard, and kept trying long after it was clear to most of the market that they didn’t have traction. The owners of Windows phones were some of the most vocal champions at the time too. They legitimately made good but unpopular products at the time.
It's ironic, but Google's monopoly was already well in abuse when Windows Phone was around, and being used to block Google's competitors. Gmail required you enable "less secure apps" to let a Windows Phone connect to it and they continually blocked Windows Phone from having any access to YouTube as well. Even when Microsoft invested their own development resources in building support for Google's already monopoly-scale platforms, Google would just find excuses to block them.
I believe Gmail switched at that time to pushing you to use effectively a Gmail-proprietary method to authorize access to a Gmail account. Nobody else was doing it at the time, I think official OAuth scopes actually came later.
And bear in mind, OAuth to authorize mail access is weird. Generally speaking, mail clients use IMAP or POP3 and SMTP. One of the more popular open source Android mail clients, K-9 mail, still doesn't support it: https://github.com/k9mail/k-9/issues/655
But the biggest issue is that, like the "unknown sources" checkbox in Android, Google uses scare tactics to discourage non-Google-proprietary apps and protocols. Use Google apps on Google devices only, otherwise you'll have to authorize "less secure" things.
I think people who talk up Microsoft's phone efforts must have been wearing blinders. I won't argue that Microsoft's phone was decent at one point, maybe even "Great" for a short while. But by the time they had a decent phone, they'd already burned out all the good will people had towards them on Mobile. Microsoft had... 4? Different mobile operating systems over the 15 years or so they were selling mobile OSs. I honestly lost count.
Microsoft had WinCE then Windows Mobile for quite a few years before the iPhone, then Apple released the iPhone, Windows Mobile started hemorrhaging market share... so Microsoft dropped WinMo like a bad habit, leaving developers and users out in the cold. STRIKE 1
Windows Phone 7 came out with piles of great press and hoopla, but notably, it didn't support older hardware so existing owners were left in the lurch. Developers were also screwed because WinPho7 wasn't compatible with older apps. It was a pretty interface with no software, no users, and no developers. It also had some serious shortcomings, ironically iPhone enterprise support was much better. WinPho didn't work well with Exchange server or Office. But that's OK because you didn't have long to be frustrated with WinPho 7 because 2 years later, they released Windows Phone 8 which dropped support for all old hardware. That's right, if you bought a brand new Windows Phone 1 year after launch, you couldn't run the next major release of the OS.
But the few people who managed to stick around after getting screwed over twice... boy did they love their Windows Phones.
After a certain point, there were just no developers, OEMs, or end users left around willing to be Charlie Brown to Microsoft's Lucy.
They fucked people over further than that. A whole bunch of Win8 devices were promised an upgrade to Win10, and then weeks before release, Microsoft were like "nevermind LOL" and people were furious.
Also, for quite some time before they officially pulled the plug on mobile, core MS apps would come out for Android first.
Microsoft tried hard, and kept trying long after it was clear to most of the market that they didn’t have traction. The owners of Windows phones were some of the most vocal champions at the time too. They legitimately made good but unpopular products at the time.