Everybody(well, every writing body) goes through that moment:
You pick up a copy of the thing everyone is raving about. A few pages in, you want to hurl the book against the wall in sheer frustration - it's bad. REALLY bad. Head crushing, vomit inducing, mind numbingly BAD. Not long after that, you want to cry, because this thing got published. Then you go through the emotional steps...you get depressed, get mad, incredulous...finally accepting that bad books can, and do, get published.
Below are just my own thoughts - to my knowledge, no in depth study has ever been done about any of these.
There seem to be basically three things that will have a less than stellar book on the market.
The first is a writer with a huge following, that's now pumping out books that aren't as great. It happens, but that first couple of manuscripts still had to be great.
The second, is that there's some aspect of the work that's so strong, it overshadows a lot of the problems. I'd put Dan Brown in this camp. Hated his sentence structure, oversimplifications, weak characterizations, and flagrant disregard for facts and history. But damn - I had to know what was going to happen next. That's what I'd call a weak writer and a great storyteller. And the simplicity of the prose helped keep the pace fast, though I still wish he'd thought a little more highly of his audience.
The third, is filling an empty niche. I'd put twilight here. Every eight to ten years, there's a new, hot vampire hero for the latest group of teen girls to swoon over (am I the only one who noticed that?).
Maybe even less time.
When I was a small bit, there was a tv show called Forever Knight. Horribly cheesy. Had the fan base from Beauty and the Beast (another tragic male lead). Though Lestat was around before then, he caught on big in the early 90's, replacing Mr. Knight. After Lestat, came Angel, and then Spike.
Now those two are still running around, but the bloom is quite off the rose, particularly for girls who don't want to like what their older siblings did - and want something new.
Charlaine Harris and Laurell K. Hamilton have been about for a while, but those (especially Hamilton) are not written for a teen audience - unlike Buffy, where teens were the primary target, or Knight, who had more of a Barnabas thing going on, and sex was implied rather than implicit.
I noticed one other vamp series aimed at kids, but it glosses over the romance aspect.
So there's this fresh generation of newly hormonal tweens, starving for their slightly dangerous, oh so sexy, bad boy with a heart of gold. Enter the ultimate wish fulfillment character, with the ultimate self insert blank slate. Had another teeny bopper bloodsucking hunk hit paper first, that would have been the hot thing instead.
What does all this mean to you? Besides that some luck can be quantified when analyzed far enough, not much. Keep working to write the best book you can, because it's better to rely on strong writing than good timing.