Actually the whole browser wars thing was not quite as simple as that but it's easier to bash MS.
If you're not particularly interested then don't bother reading on...
Originally IE (3.1) became popular because the version of Netscape at the time was abysmal at best, there were other browsers which Netscape crushed by pricing out of the market (Opera barely survived at the hand of Netscape). Netscape crashed for a passtime, was expensive (compared to IE which was not originally released for free), it was clunky and offered no real value for the money (except a basic html editor).
Netscape then got bought by AOL, and with AOL being the kiss of death to everything they get involved with; Netscape didn't have a hope in hell. To be honest I'm still very suprised to this day that AOL allowed the Netscape source out to become the Mozilla engine, it's very unlike them, I can only imagine it had something to do with Mosaic.
MS did start relying on (and using) their market dominance because they're a company and that's what companies do regardless of what market they're in. If you're in the top spot then you can't really make any serious money by improving the product, it only has to be better than the other choices available. In that respect FireFox helps massively to improve IE because MS does seem to produce its best work when it has a genuine competitor.
Integrating IE into Windows also made great sense from a developer point of view as it was the same development team so they saw lots of opportunities to reuse code from IE to do nice stuff in the Windows interface without much effort, that's what made IE completely impossible to remove.
I heard rumours that MS were looking at dropping IE7 as a seperate app at one point, and they only really got their butts in gear when it looked like Firefox might actually become popular.
Sure there are holes in IE but FireFox is no better - every time I have to open FireFox to do some testing (usually once a month or so) it needs to download and install another security update, so it's hardly in a position to be laying claims to any superiority there.