To be clear, when I say quality, I don't just mean this in the narrow sense of following the rules that writing teachers say you should. Harry Potter and Twilight both became popular because of some essence that they had---in my opinion, probably related to the world building and a certain difficult-to-describe experience of reading. Both of those books had "flaws" that were widely criticized. But they really hit home with their respective audiences.
Why did the first Harry Potter succeed, before J.K. Rowling had made a name for herself? In my opinion, it's because readers loved it so much that they went out and told their friends to read it. That's what I'm talking about when I mean quality---the irresistible quality that makes me fall in love with everything the author is doing.
Most books I see, even traditionally published ones, just don't have that.