The Mac, though its market share was never large, especially when compared to the well over 90% marketshare of Microsoft Windows-based PCs, had always attracted an incredibly talented, incredibly dedicated group of developers who cared deeply about things like design and user experience. OS X enjoyed not only the traditional Mac OS community, but the NeXT one as well. That talent share always felt disproportionate to the market share. Massively. And a lot of those developers, and new developers influenced by them, not only wanted iPhones and iPads, but wanted to create software for them.
The numbers game matters, but it’s just one factor among many.