All it takes is luck to be published? Not the fact that your story is good enough to be read?
Umm... say what?
Okay, here's the thing...
There is SOME luck involved. But luck is only a tiny part of the process.
Yes, it takes luck to have the right type of story at the right time. There is some luck involved in finding an agent in that your query letter might get a rejection if the agent is in a particularly bad mood or the market's just not right at the moment, or whatever.
But I think you've got the idea reversed.
Talent, hard work, dedication, perseverance, and a devotion to writing a story that YOU feel passionate about it and telling it not only to the best of your ability, but pushing yourself to improve your abilities so you are telling an extremely solid and well written story.
After you have
finished this story and gone through edits and beta readers and every channel you can to make sure it is the best story you could possibly tell and told in the best way you can possibly tell it, then you have to put in the work in finding an agent that will be passionate about your story.
From there, luck does come into play to some extent. But there's no room for the luck to come into play until you have finished a story that is solid.
Now, I think you're referring to the fact that there are books out there that are best sellers that a lot of people think are not terribly well-written or original.
The thing with that is... there has never been a book that pleases ALL readers. And there never will be. Everyone has different tastes. And the tastes of the masses change, just like clothing styles change and fads change.
But what it all comes down to is that each book that has done well has done well because the author has poured years worth of hard work, blood, sweat and tears into. The only way an author can stick with it for this long is to choose a story and characters that they feel
passionate about. I don't believe that JK Rowling said "gee, I think a book about a boy wizard is going to be a money maker. I'd better write one." She, like so many other bestselling authors, wrote a story that she couldn't get out of her head.
The hard truth of the matter is that writing is a labor of love. A lot of work needs to go into a novel and you need to be willing to stick with it. You need to face the truth that the majority of published writers are not famous, are not rich, and have to work their tails off to make a living on writing. If you are in this for the money and hoping it's a get-rich quick scheme (and not saying that you are), you will be disappointed.
In fact, if you spend all of your time trying to figure out how to write a book that will appeal to an agent, publisher, or the masses, you will fail. You need to find a story that appeals to YOU and if you write it well enough, then you have a much greater chance of finding an agent and a publisher and readers.
It's similar to many writers mentioning that they thought they should write romance novels because it's the top selling genre and therefore the money is better. The writers who decides to write a romance novel 'for the money' soon realize that you can't write something for the money and have it turn out well. You have to write the type of book that YOU would like to read. And if it's the type of book that you would like to read and you work hard at your craft and write it well enough, then chances are there are other people who are out there that will enjoy it.
But I would say that you're wasting precious writing time trying to find out the 'magic' secret to getting published. And unless you have finished a novel yet, you should save that for later. Finish your novel. The amount you will learn about the craft from finishing it, as in reaching THE END not only in the first draft but then going back and editing until you feel it is the best it can possibly be is more useful than trying to figure out how to get published when you don't have a story that's ready TO publish yet.