More to the point, Microsoft never sticks to a product line long enough to warrant investment in it.
Microsoft had the leading smartphone OS before it was called a smartphone (remember PocketPC's ?), before RIM's blackberry became the de-facto business device.
False. PocketPC was a desktop clone for small device form factors that sucked so bad it was hilarious. Sure if you wanted Win95/NT4 on a phone it'd have been great...but then, you had to use a stylus to do anything as that was your mouse, and it required a full keyboard. Could it be considered a Smart Phone? Yes, but it absolutely sucked and never really had a very big market share - no where near majority by any means.
Palm and then RIM won b/c they actually did stuff the user cared about in easy to use manners.
Google set their eyes specifically on overtaking RIM and Apple came up and offered something compelling that wasn't a stuffy old blackberry clone.
Yes, Google and Apple aimed at displacing RIM b/c RIM was the de facto standard for anything more than a basic cell phone. If you wanted email, you got a Blackberry. RIM would probably still be a leader in the market if they hadn't screwed up with a highly centralized network design and had a 1 week network outage - which led to a lot of execs getting iPhones and demanding that their IT departments integrate the iPhone so they could use it; both Apple and Google exploited that, though Apple was the clear winner having a superior and flashier product that the Exec's loved.
The end result is that Apple is the Market Leader for the Smartphone, if you're not doing it Apple's way, you are doing it wrong. Google recognized that and changed Android from knocking off Blackberry to knocking off iOS, Nokia meanwhile kept on trucking out phones that appealed to people who didn't care about smartphones. Microsoft's killed it's own market share in order to push Windows Phone 7, then 8, and now 10. Each time halving their market share. So they went from 11% in 2001 to 0.7%.
Microsoft screwed up and lost it's foothold in the mobile scene. Had they never dumped the PocketPC, they might be market leaders today.
Well, if Microsoft hadn't abandoned PocketPC (aka Windows Mobile) then yes they'd probably have a bigger market share, but it'd still be a pittance compared to Apple and Google. As I said, PocketPC was basically the Windows Desktop in a small form factor - it would not be able to compete with Android or iOS. It also didn't have updates of any kind - builds were done by hardware vendors (not Microsoft) and there was no AppStore kind of thing for it. What you got when the device shipped is what it had when you retired it.
But that was always the Microsoft motive operandi - everything was focused around the Windows Desktop Environment or was an extension of it. For mobile, they put out PocketPC/WindowsMobile to exand Windows Desktop to mobile/small form factors; they put out Windows Server to push Windows Desktop into the Server Room; then extended Windows Desktop into the XBox to capture game consoles; they put out Windows 10 IoT to capture things like RasperryPi's (accessible and programmable only via Visual Studios, no direct user-interface).
No, Microsoft has not really learned the lesson of the failed Windows Phone experiment - that they won't ever hold the entire market, that people don't want Windows on everything. They're done a bit better with Azure and responding with LInux capabilities on it - but it still runs on top of Windows and all the overhead that incurs.