They haven't really. This claim is a result of stock PR story.
The PR department knows that you don't get free advertising by saying "Yeah, so she wrote a book and then we bought it" so they manufacture a struggle the author has overcome, like when like when Rowling claims to have been penniless, but could still afford to go to coffee shops to write. I mention her because so much of her well rehearsed struggle is outright nonsense. She also claims she was forced to use initials, when the reality is she cynically did this in a direct imitation of Tolkien's name. So she warmed up this old story, which was valid for someone like C.L.Moore, but is a joke given that most fantasy novels are written and read by women. She then cynically told this lie hundreds of times.
So if you think most best selling authors are rejected, you're just buying into the carefully sculpted artist story you're being sold. You don't hear a story like "oh yeah, sold it to a guy who knew my college professor, hadn't even finished it yet," because that doesn't make a feel good story.
Are some rejected? Yes, especially when the author hasn't bothered to edit his own book or offers it to the wrong publishing houses. Are all of them? No not even a majority were rejected.
Because agents and editors aren't very good at their jobs.
This has become more obvious with the growth of self-publishing over the past 10 years. A lot of those rejected authors went on to publish their own books and they became if not best sellers, stronger sellers than most of what big publishing puts out. So the evidence is mounting that the publishing industry was failing miserably at its job. This would be amusing except that probably hundreds of writers have committed suicide over the years because of their rejection and tens of thousands of excellent writers have quit writing when they might have been writing books I'd have loved reading. It's a tragedy...but the e-reader and self-publishing has erased that tragedy and given the power of approval over into the hands of readers themselves, which is where it belongs.
The answer is simple. Because people make mistakes. How many wonderful musicians were told by some record executive that they didn't have what it takes to pursue a career in music? Tons. Sometimes people lack vision. They can't see that something will eventually come to be embraced by great numbers of people and they can't see that what they're refusing may one day come to be seen as revolutionary or exemplary. There are best-selling books that are utter rubbish, through and through while people sitting on brilliant novels and stories are ignored and remain completely unknown. Remember that not all best sellers are inherently wonderful. People buy a heap of nonsense all the time. It's not always about the quality of what's being offered up, it's about whether or not the person making the decision thinks the work will make a huge profit. Those manuscripts that were rejected were rejected because the person who refused to sign off on them believed that was the right business decision.
You just hear about the ones that are popular.
Like why do big movie stars turn down blockbuster movie rolls ? It makes good print.
People are often surprised when they hear about books getting rejected by like 10 publishers and then going on to become best-sellers, but there are reasons why this happens.
For one thing, the quality of a book is highly subjective and it depends very much on the reader. Some books, people have been unable to put down, that I haven't been able to finish, and vice-versa. There's one book that I think is an absolute literary masterpiece, that only has a rating of about 3.5/5 on goodreads, for instance, for what that's worth. So it can happen that a publisher just doesn't happen to like a particular book. Likewise, there's no real way to determine which books become bestsellers and which ones don't. Some just sell and sell, others don't. There's no real way to tell- for instance, Harry Potter sold like crazy. I personally don't think it's the greatest stuff I've ever read by any stretch of the imagination, but people just kept buying it.
There's no real math behind any of this. There isn't exactly a formula that you can plug a book into and determine how good a seller it will be. It ultimately comes down to how the publishers, and the readers, feel about the book, and there's no real way to gauge that.