The main obstacle to fanfics flooding the market is copyright. As long as the original author holds the copyright for their work, fanfics can only live as free stuff on the internet. (Or, as Kirk points out, they can be "reskinned", "retooled", so they're not obviously recognisable as fanfic. In which case, it all depends on how good your lawyers are compared to the lawyers of the original writer.) I personally think that making money off somebody else's work in this fashion is sort of stealing. Cervantes notably was extremely unhappy about someone publishing a Don Quixote fanfic, and went on to publish his own Don Quixote II, in which he mocked the fanfic. But such moral considerations are beside the point.
Once the copyright is over, the work you wanted to write fanfic about is either long forgotten, in which case the fanfic loses its point, or it's become a classic, in which case judgement of your fanfic is going to be rather harsh: what can you, unknown modern writer, add to the time-honoured classic? Such works do exist, but are less common.
And then, when a work is old enough, it turns out that yes, you do have something to add to it. Enough time has passed that retelling the same story in a different way is now original, interesting, respected, literary. Once and Future King and Mists of Avalon are both Le Morte d'Arthur fanfics. Ursula Le Guin's Lavinia is an Aeneid fanfic. Except that at this point they are no longer called fanfics.
What differentiates your run-of-the-mill fanfic from works like Once and Future King or Wide Sargasso Sea that you mention, is that the former aim mostly at producing more of the same, with some measure of insert-fic and/or doing things to the original book's romances. Whereas works of the latter kind seek to engage with the source material, and using it, say something new, unique. In this fashion, they outgrow the "fanfic" definition.