This is an excellent question that came up recently, and the answer isn't as obvious as you might think. Also, the answer really matters, if you're an author hoping to be published somewhere, or striving to self-publish wisely. There is no single answer, either: it will depend on the context, on the kind of publication and the dynamics of that particular market.
There is a great deal more to say on this topic, but here's a good place to begin:
- If it's a periodical, like a literary review or a genre-fiction magazine or a popular blog, the editors drive the content. Contributors check the editorial calendar to see what topics will be needed when, and they pay close attention to the publication to determine editorial slant, and query/write to that slant. Readers vote with their subscriptions/readership. Strong editorial leadership will draw readers (and contributors!) loyal to that slant/content.
- If it's a one-off book, the author drives the content, writing the story (or making the case, in nonfic) that the author feels "needs to be written." Editors/agents can take it or leave it; ditto the readers, ultimately.
- If it's a book series, or if that "one-off book" found an enthusiastic market, then the readers begin to drive the content. A friend of mine got his first big break with a paranormal/monster graphic novel. Boy was he surprised when he went on to write an SF novel and then a pair of children's (middle grade) books, and each bombed worse than the last, while his new audience clamored for more monster stories. Finally, he wrote another monster story, completely different from the first one—and it was even more successful than the first one. His readers forced this wide-ranging author to write what they liked to read, and because he needed to eat and pay rent, that's what he writes now!