Windows Mobile should have been RIM's wake-up call: UX was pretty dismal; but it was a more or less architecturally successful implementation of 'well, just build the computer smaller!' school of mobile design. Once Apple came along and dealt with the UX problem... Game over man, game over.
I've wondered about this part a little bit. Windows Mobile was a disaster in the market, and Microsoft stopped seriously investing in mobile phones until after the iPhone took off and they suddenly realized a huge missed opportunity. But if you go back 7-8 years ago, when there were lots of Palm and generic hardware phones running Windows Mobile, Microsoft boosters claimed that they would beat BlackBerry "because of the third party applications", which actually seemed somewhat plausible at the time. People were writing more Windows Mobile apps because they knew the Win32 API.
But it didn't pan out that way. RIM under-invested in building a 3rd party developer community -- which did exist, in spite of major frustrations with the platform -- for years. It didn't matter, and by the end of 2006 RIM was essentially the only player in the game. When the iPhone was released in 2007 it didn't even allow 3rd party applications. I speculate that RIM's historical success despite a weak app ecosystem caused them to downplay its significance, meaning when Android and iPhone put out good developer tools with rich, familiar APIs, with a large consumer market hungry for apps, RIM was flat-footed and struggled much too late to catch up.