The popularity of kinds and categories of books tends to come in waves.
Time was, America was enamored with the Old West. (And why not? The story of westward expansion is the story of our country.) Nowadays, that has waned. Oh, there are still plenty of books published about the West, and there always will be. But they do not command the share of the market they once did.
For a time, Science Fiction was all the rage, and writers were tripping all over themselves to write that stuff. And Science Fiction spawned a lot of interest in Fantasy. Fantasy is still popular in all its types and kinds, but Science Fiction isn’t as prevalent as it once was.
Romance novels had their days in the sun as well, and while they continue in popularity, there are not as many as there used to be, and entire categories of romance have all but disappeared.
Mysteries have always been popular, but they wax and wane as well, along with shifts in the kinds of mysteries that are selling like hotcakes. And there are crime novels, police procedurals, private-eye novels, political thrillers, spy novels, and so on.
Agents and publishers and others sometimes encourage aspiring and even accomplished authors to climb aboard the current bandwagon; to write something in the genre that’s popular this year.
Trouble is, those writers may not be drawn to the category and, as a result, what they write is uninspired, formulaic, or just plain bad. And, by the time the book gets to market, tastes have changed, that parade has already passed, and “the next big thing” isn’t so much of a thing anymore.
The thing to do, many writing gurus will tell you—and I tend to agree—is to write the kind of book you want to write and hope for the best. It may not make you rich, but the odds aren’t that much different.
And at least you will have enjoyed the writing of it.