Herman Koch’s “Dear Mr. M” begins with an ambiguous revelation: “Dear Mr. M,” a nameless narrator writes, “I’d like to start by telling you that I’m doing better now.” On the one hand, we’re curious: Better than what, we want to know. On the other, there’s an undertone of menace, as if Mr. M has been the cause of the unnamed malady. And why not? Mr. M is a writer, one of Amsterdam’s finest, an aging literary lion whose best years are behind him, although he keeps working.

The narrator, it is clear, has it in for M. The first part of Koch’s novel details his stalking of the author and his family. Living in the same apartment building, he keeps close tabs on M, his much younger wife and their small daughter, tailing them to book events and even to their weekend house. “There are books,” the narrator reminds us, “in which the writer appears as well. As a character. Or there’s a character in the book who enters into a discussion with the writer. I’m sure you know the books I’m talking about. You wrote some of them yourself.” And then: “That’s what makes this different. I’m not a character. I’m real.” In many ways, that passage is the key to this often exhilarating and unpredictable novel, which opens before us like a set of nesting dolls, each narrative turn revealing another, as it moves between the story of the narrator and the writer, and that of the real incident behind a very successful novel that M published 40 years ago called “Payback.”

If all that sounds a little meta, it is, although not in an off-putting way. Koch, a Dutch writer whose 2013 novel, “The Dinner,” was a surprise bestseller in the United States, explores the nature of storytelling from both a reader’s and a writer’s point of view. Some of the funniest parts of the book (and it can be a very funny book) involve the depredations an author must endure: the readings, the literary events. “You can put up with anything as long as you’re allowed to slowly sink back into yourself after fifty minutes,” M reflects about his dread of meeting the public, with their inane questions that he has heard hundreds of times before. For M, like many authors, writing is performance; his process is one of paring, eliminating coincidence and serendipity in favor of a fabricated narrative. That he understands this to be false is one of the exquisite tensions of the novel. “If he were to write down what he really thought,” Koch writes, “in its rawest and most unabridged form, it would all be over, just like that. The readers would turn their backs on him in disgust. Bookshops would refuse to sell his work.”

The irony, of course, is that this is precisely what “Dear Mr. M” seeks to do. Koch shows us not only the interplay between the writer and his stalker, but also that between M’s most successful novel, “Payback,” and the deadly events that inspired it. “It’s the writer’s task,” M says, “to bring back that naive belief in the accident,” and if this is precisely what his own work fails to do, it only makes that proclamation more profound.

Throughout the book, Koch plays with narrative authority, switching from first to third person, from sections in which M appears to be the protagonist to others in which the stalker takes the lead.

Then, there is a long section in the middle that narrates the story of two high school students who do away with a teacher who has had an affair with one of them. Is this a piece of “Payback” that we are reading? Yes, to some extent, although these pages are never presented in such a light. More effective, then, to read it as Koch’s attempt to reveal the material out of which an author (in this case, M) fashions a book, the raw experience that is honed into fiction, chaos reconfigured to make a point.

In that regard, “Dear Mr. M” is, most essentially, about how stories build upon themselves, each event influenced, triggered even, by the last. That puts a burden on Koch to invent, continually, new turns. If this doesn’t always work as he intends, for the most part he pulls it off. Yes, the “Payback” section drags a bit, with too many high school moments that don’t add to the narrative. Yes, there are some eyebrow-raising twists, as when stalker and author come to a reckoning.

Ultimately, though, such lapses never distract us from the thesis of this unexpected novel, which is that imagination, like the world, confounds and reveals us at every turn. “It was like with a story,” Koch writes in the closing pages. “Like with a book. What is it we look for in a book? That someone goes through a process of maturation — that he achieves insight? But imagine if that process and that insight simply aren’t there. Wouldn’t that, in fact, be much more like life itself?” Here, we see the territory “Dear Mr. M” occupies, the middle ground between literature and life, intent and open-endedness, making the book a darkly comic meditation on creativity and the limits of creativity, on the art of fiction and its discontents.

David L. Ulin, a former book editor and book critic of the Los Angeles Times, is the author of “Sidewalking: Coming to Terms With Los Angeles.”

Dear Mr. M

By Herman Koch

Translated from the Dutch by Sam Garrett

Hogarth. 416 pp. $26