Windows Phone 8 may not be selling well, having captured just 5.6% of U.S phone sales in Q1 2013 (despite being a very good operating system). In April of this year, Microsoft won a legal battle that means every Android OEM must pay Microsoft to sell a phone, including LG, HTC and Samsung.
That deal may be one of Microsoft's most profitable, after BGR estimated earnings from 2013 Android sales at $3.4 billion. According to Microsoft, 80% of Android phones sold in the U.S - as well as devices sold around the world - come under the patent deal, which nets Microsoft $8 per Android device.
And that $3.4 billion figure is set to increase exponentially as more Android devices are sold over the coming years. In 2017, Microsoft is expected to make $8.8 billion in revenue from the sale of 1.5 billion Android devices, assuming Microsoft collect royalties from 75% of Android devices. If Microsoft only collected royalties for 50% of all Android devices sold, they'd be inline for a $5.9 billion payout during 2017. This money is essentially free, as Microsoft contributes nothing to the Android ecosystem.
Not only does Microsoft make money from "most" Android devices sold, but also from a massive range of other companies who use the exFAT file format. Microsoft has deals with Sharp (for TVs), Nikon, BMW and Volkswagen, all of which pay Microsoft a substantial yearly revenue.