Anemic competition in the '90s (Nintendo and Sega's failed Dreamcast) made Sony dominant, and the PS2 kept them there. Microsoft then spent quite a bit of money taking them on throughout the 2000's, and eventually won (in the US, at least).
Also, consumers don't care about how difficult a console is to code for, they only care about the games. Game publishers don't really care either, they only care about the potential market (which was massive).
In what sense has Microsoft "eventually won"? Sony actually makes money on games, Microsoft more-or-less breaks even. The PS4, so far, is outselling the XBox One, even in the US -- despite Microsoft breaking down and offering a kinect-less cheaper version.
Really, the winner was Nintendo, which sold a buttload of very cheaply made consoles for close to the same price as far loss-leading higher-powered competitors.
Of these companies, only Microsoft was spending profits from other sectors to build its position in the console market.
Incorrect. The Dreamcast had no OS. It has a proprietary firmware like all consoles of the time. Game developers had the choice to use a proprietary RTOS, a Windows CE based OS, or no OS at all. If they used an OS, it would ship on the same disc as the game. Very few games actually used Windows CE.
I remember articles discussing how Microsoft's experience developing DirectX for the Dreamcast helped them craft even better/more-developer-friendly ones for the XBox.
Also, consumers don't care about how difficult a console is to code for, they only care about the games. Game publishers don't really care either, they only care about the potential market (which was massive).