“He grabbed me by the collar, ripping my necklace, and he knocked me to the floor,” declares Prince Harry, in his memoir. “I landed on the dog’s bowl, which cracked under my back, the pieces cutting into me.”

It’s vivid stuff, right down to the passive-aggressive “I didn’t attack you, Harold”, uttered by a “piping hot” Prince William as he storms out, leaving behind a broken brother and shattered dog bowl.

This is the authentic voice of Prince Harry: frustrated, peevish, detailed, retaliatory. This is writing of a high order. But it is not Prince Harry’s writing.

The words are those of JR Moehringer, the veteran American ghostwriter brought in to turn Harry’s damaged emotions and enraged memories into best-selling prose.

A Pulitzer Prize-winning journalist and novelist who has ghosted memoirs for the tennis player Andre Agassi and the Nike founder Phil Knight, John Moehringer was reportedly introduced to the prince by the actor George Clooney. He is said to be earning a seven-figure sum for writing Spare, which is out now without Moehringer’s name on the cover.

The role of ghostwriter is one of the strangest in literature: a combination of therapist, ventriloquist, interpreter, translator and muse, he or she is the below-stairs employee of a famous person who demands to write a book but who cannot, in fact, write.

More than half of non-fiction best-sellers are ghostwritten, as well as a substantial proportion of the fiction. Only about one in five of the celebrities, actors, sports figures, politicians, chefs, misery memoirists, pop stars and entrepreneurs in the best-seller lists actually write their own works.

Prince Harry has been open about employing Moehringer’s pen but most are far more coy. Sometimes the ghostwriter is acknowledged with a sly “as told to” or “written with”. More often the surrogate author remains invisible.

You may be able to judge a book by its cover, but not who wrote it.

The role of ghostwriter is one of the strangest in literature.... He or she is the below-stairs employee of a famous person who demands to write a book but who cannot, in fact, write.

The ghostwriter has been lurking in the shadows from the dawn of creativity. Mozart was paid to write music for wealthy patrons to give the false impression that they too were composers of genius. In Edmond Rostand’s 1897 play, Cyrano de Bergerac anonymously writes poetry to help another woo the beautiful Roxane.

John F Kennedy’s 1956 book Profiles in Courage, depicting the bravery of eight US senators, helped to launch his presidential bid. Only in 2008 did his speechwriter, Ted Sorensen, reveal that he had drafted the whole book and “helped choose the words of many of its sentences”, which is a fair definition of “writing”. Hillary Clinton’s name appears alone on the jacket of her memoir Hard Choices; on page 597 of that 635-page book, she briefly mentions the three-man “book team” who “helped” her.

Some are entirely open about employing others to express what they cannot put into words. “I hear it’s a terrific book,” Ronald Reagan remarked of his collected reflections, An American Life. “One of these days I’m going to read it myself.” The former glamour model Katie Price has produced more works than Shakespeare but readily admits she leaves the “typing” to others.

The term ghostwriter was coined in the 1920s by Christy Walsh, the dominant literary agent for American sports celebrities, from Babe Ruth onwards. Walsh’s first rule: a bad ghostwriter “usually makes the mistake of thinking that he ought to write the way his celebrity talks. That is an error. He ought to write the way the public thinks his celebrity talks.”

Ghostwriting is a form of deception, allowing someone to take credit for another’s writing, often anonymously. It can be hugely lucrative. In the past a qualified ghost could demand up to a third of the advance, plus royalties; today the figure is probably closer to 10 percent, but that still represents a decent sum for a writer like Moehringer.

Only about one in five of the celebrities, actors, sports figures, politicians, chefs, misery memoirists, pop stars and entrepreneurs in the best-seller lists actually write their own works.

Established writers tend to look down on ghosts as mere hacks, literary guns for hire, but the job is far harder than it seems, treading a fine line between feeding the conceit of the subject and writing something that is readable, realistic and, if possible, revelatory. The ghostwriter is like the literary barrister, arguing the author’s case with as much eloquence as possible but leaving final judgment to others.

The peculiar relationship between hired autobiographer and subject was explored by Robert Harris in his novel The Ghost, later adapted into a film by Roman Polanski, a peculiar dance where vanity, truth and political manipulation meet.

Most ghostwriters end up loathing their subjects. The job demands a capacity for what the writer Hadley Freeman (who ghosted Victoria Beckham’s fashion book That Extra Half an Inch) calls “self-surrender”; a willingness to enable others to be seen as they want to be seen. It is a form of servitude: in France, ghostwriters were traditionally known by the racist term nègres.

Writing anonymously in The Guardian, one ghost complained: “I am a lackey … it’s painful writing such tripe.” Tony Schwartz ghostwrote Donald Trump’s book The Art of the Deal, and then regretted its success. “I put lipstick on a pig,” he said. “I feel a deep sense of remorse.”

The ghostwriter may also be a betrayer, coaxing an employer into embarrassing revelations that will sell. Andrew Crofts, Britain’s most prolific ghost, who has written more than 80 books for others, describes his role as “lawyer, confessor, therapist and friend”. Would a friend really have encouraged Harry to reveal that he lost his virginity after he “mounted” an older woman “like a young stallion” in a field behind a pub?

But spare a thought for John Moehringer. He has had to spend months listening to the prince’s self-pitying monologues, all of them vengeful, naïve, furious and ultimately unimportant; urging greater revelation; transcribing his subject’s solipsism, nodding appreciatively and surely bored rigid.

Whatever he is being paid, it is not enough.

Spare, by Prince Harry, the Duke of Sussex, is out now from Random House

Ben Macintyre is a writer at large for The Times of London and the best-selling author of The Spy and the Traitor, A Spy Among Friends,Double Cross, Operation Mincemeat, Agent Zigzag, and Rogue Heroes, among other books. Macintyre has also written and presented BBC documentaries of his work