if it was an exact science - as some writing courses suggest - there would be far fewer books on sale. Certainly a narrower choice. Publishers and sellers would never take a wild punt on an unknown author.
Some stone cold algorithm would take the place of fickle, capricious, or cynical but occasionally gloriously risk prone agents.
Some computer programme would then 'write' all the new books under a variety of names with a proven track record of x+n sales.
No doubt small guerrilla presses would start up and we'd be back to hawking our wares on the street and in pubs and coffee shops.
They haven't killed the human factor yet, but accountants in ruthless pursuit of the bottom line are doing their cold-blooded best.
That's why we need luck.
The luck of the right person spotting a book cover which appeals to them.
The luck of them having time to flip through and be caught by a resonant phrase or description.
The luck of them having spare money right then to buy it.
The luck that it will live up to the initial promise in their eyes.
The luck that they will recommend it to several friends, who will then buy their own copy it and repeat the process.
That last one is the holy grail of publishing, and despite their best efforts the big businesses still haven't quite figured that one out ;-)
Which is why hopefuls still send work in 'on spec'. Sometimes doing amazingly well, and sometimes just earning a decent living. Mostly just earning enough to keep them hoping.
Gyppo