Some authors are inspired by their relationships, others by travelling the world, but for David Baddiel it was a family outing to the Harry Potter Warner Bros Studio Tour in Leavesden. "My son, Ezra, who was around eight years old, asked why Harry didn't run away from the Dursleys and find some better parents," he recalls. "It gave me an idea for a world in which children could choose their own parents and it immediately sounded like a classic children's story."
The result was The Parent Agency, and more than half-a-million book sales later, Baddiel has become a regular on the bookshelves of the nation's children. "It turns out I have a facility for it," he says. "Being a comedian allows you to remain a child inside, so when I sit down to write a new book I think about what my inner child wants."
He was already a published novelist, writing increasingly literary adult fiction, but his imaginative, finely-plotted stories struck a chord with his new audience.
"Children buy books, because they think they'll be fun, or funny, so you have a very direct relationship with your readers and kids will tell you exactly what they think," says Baddiel (55). "To write a successful literary novel, you have to convince the cultural gatekeepers; you need a good review in the Guardian, or to be nominated for a big award. No child buys your book because they want it to be seen on their coffee table."
Baddiel is a man of many talents. First and foremost a comedian, he's dabbled in theatre, podcasts and screenplays and remains perhaps best-known for co-creating the England football anthem Three Lions.
The shift into children's writing was never really planned, but Baddiel argues that the same principles underpin most of what he does.
"I do see myself as a writer, but if I was going to put anything on my passport - and I know it sounds a bit pretentious - it would be storyteller. That takes me all the way from comedy to a documentary I'm currently making about holocaust denial - it's all storytelling."
He can draw a particularly clear line between his children's books and stand-up comedy. Back in the late Eighties, his big break came from a sketch show called The Mary Whitehouse Experience, in which he and fellow up-and-comer Rob Newman did a sketch called History Today, playing two old history professors slagging each other off like children in a playground.
"The heart of its success was the truth that no one really grows up," says Baddiel, "that everyone, except possibly Michael Gove, remains a child and is just busking their way through adulthood. A lot of comedy is about proving that adulthood doesn't really exist."
His new book, The Taylor TurboChaser, is about a disabled 11-year-old girl, whose wheelchair is transformed into a supercar and it slots very comfortably into his canon. "A lot of my books dig into wish-fulfilment," he says. "The new one is about driving and one of the things I wanted to do when I was nine was drive."
Is Baddiel still an avowed petrolhead? He laughs, then says: "No, not really. I did have a classic car, but I liked the aesthetic more than the tinkering, so it fell apart. My dad was more into it - he had a Triumph Spitfire, then a Ford Capri, and I used to sit in it and play with the gear-stick and steering wheel. I think that's where the story came from."
That the book centres around a wheelchair was not meant as social engineering - "I didn't think 'this is really important', it just felt more poignant and interesting" - but Baddiel is conscious of the increasing calls for diversity in children's literature.
"I have included BAME (black, Asian and minority ethnic) characters in all my books," he says, "just because it's real. My children are at state schools and have diverse friends. It would seem ridiculous for my schools to be anything but diverse - it just wouldn't reflect modern reality."
The book also has a female protagonist. "Most of my books have centred on boys and I wanted to get away from that," says Baddiel. Father to an 18-year-old daughter, he wanted to try writing from a female point of view, but there was another reason, too.
Even just a few years ago, Baddiel says, there was a sense that male protagonists were safer - that girls would read about boys, but that boys might not read about girls.
"I hope that's not true anymore," he says, "and that having a female protagonist will make no difference to boys. I do get a sense that things have moved on."
As a father, Baddiel has been able to monitor the tastes of his own children and he's been impressed by what he's seen.
"Children are so much more sophisticated now than when I was a kid. They've grown up with the Simpsons, Pixar and the internet, rather than the Magic Roundabout. I don't write down to children comically in my books - I try to be as funny as I would be with adults, just not on adult subjects."
Denied the charms of Toy Story, the young Baddiel spent much of his time with his nose in a novel. He read Roald Dahl, Richmal Crompton, and, perhaps unusually, Billy Bunter. "My mum used to collect old children's books and I ended up in a Billy Bunter fan club called the Old Boys Book Club. Everyone in it was about 70 and I was 11. I now think of that as a bit strange, but at the time I loved it."
He read entirely fiction and only expanded into non-fiction recently. "That was a part of growing up that I rejected, like eating fish."
A parent to two increasingly grown-up children and a regular correspondent with his legions of young fans, Baddiel often does readings of his books in schools and is well on his way to becoming something of a childhood expert.
"My wife and I went to one ante-natal class," he recalls, "and all the focus was on what would happen when the baby was born. Eventually I put my hand up and said that this was all very interesting, but did they have any advice on the next 18 years?"
Perhaps unsurprisingly, they didn't and Baddiel has since experienced the twisting, turning storyline of fatherhood, with all the character development that comes along the way.
His message to expectant parents is simple: "Strap yourselves in for the long haul."
The Taylor TurboChaser by David Baddiel is published by HarperCollins, priced £12.99