You may remember that a while back I wrote about a book I was working on, a historical novel about twin highwaymen and a young maid who falls in with them and what happens to poor outlaws in a world ruled by the rich. I finished the book, turned it into my agent and--was told that there wasn't a strong market for it right now. So it went back into the (metaphorical) drawer, keeping a few other manuscripts company.
Like most authors, I get asked a lot about the book business and people are often surprised to hear that not everything I write gets snapped up by a publisher. Maybe that happens with very, very successful commercial authors--James Patterson, say, Stephen King or JK Rowling, people who could write a grocery list on a napkin and get a million dollar advance--but for most authors (and that includes NY Times bestsellers) just because you wrote a book doesn't mean anyone is interested in putting the money and effort into printing and marketing it. Somehow the idea got out there that once you get published, you're on easy street. If that ever was the case, it certainly isn't true now.
There are lots of reasons why a book doesn't sell to a publisher. It could be the wrong time: the reading public's tastes have changed, or too many books like it have come out and done poorly. Or the market is saturated. (Generally, if a book is salable but has some flaws, you and your agent will work on correcting those flaws to try to sell the book.) It could be too radical a departure from your normal sort of book. Or it could be not radical enough. In other words, there are hundreds of reasons why a book won't sell and only one reason why it will: because an editor loved it and believed he or she could sell it to readers.
What that means is that writing a book is a crapshoot for the author. You can sink a year (or more!) of time into something that isn't going to pan out. You don't know until you try and the circumstances may have changed completely by the time you're done (vampires are out! contemporaries are in! psycho chicks a-la-Gone-Girl are in! and so on). Them's the breaks.
This is why you must love writing to be in the business, because the writing is often the only reward. By "love" I don't mean hearing bells in your head, giddy happy all the time love. I have said on Twitter that some days writing feels like you're pulling barbed wire out of your ear. Every word is agony. You'd rather be anywhere than chained to your laptop. But you must love the challenge of putting a story together, or making the words you put down today better than the ones you put down yesterday, of honing your craft, because without that there's often no reward at all.
Yes, that's what it means to be a writer.