Fifteen years ago, a strange pink farm animal arrived on our TV screens. Today, Peppa Pig has her own theme parks and devoted fans around the world. What is the secret of her success?

If the story of the Peppa Pig franchise were a Peppa Pig episode, it would start with the doodles of three dejected daddy pigs who are about to quit animation. But then, in a heart-warming twist, the trio would make some nice new friends and we would leave them, rolling in mud – and enormous piles of money – at their modest central London studio. The title of the episode? Global Domination.

“I think I’m still in denial,” Neville Astley says at the “Elf Factory”, where he and co-creator and director Mark Baker lead a team of 16, alongside Phil Davies, Peppa Pig’s producer. The nickname for their studio was a joke. “But people now imagine we have gold-plated offices and command thousands of animators,” Davies says. He prefers to describe Astley Baker Davies, their production company, as “the little solicitors’ firm we formed”.

That joke would be closer to the feel of the place were it not for the pig scenes on the computer screens. Yet little Peppa, who lives on a hill with Mummy Pig, Daddy Pig and little brother George, has become a titan of screen and merchandising since she first jumped in a muddy puddle on Channel 5, 15 years ago this month. The animators are now busy making 117 new episodes, to add to the almost 300 already created.

Growth has been steady but startling. Peppa Pig has been sold to 118 territories, but a good chunk of its $1.3bn (£1.1bn) in global retail sales last year came from China. Pei Pei Zhu rolled up there in 2015 and has been celebrated this year – China’s year of the pig – with a hit movie. She has sold more than 40m books in Mandarin, and scored more than 60bn views on China’s streaming platforms.

Success has brought with it a level of criticism that the animators never expected. Peppa Pig has, among other accusations, reinforced gender stereotypes, encouraged children to be naughty, reflected a middle-class worldview and even endangered life; in Australia, the national broadcaster banned an episode in which Peppa reassures her brother that spiders are harmless.

But she marches on. Last October, Merlin Entertainments, the British attractions company behind Legoland and Alton Towers, opened a Peppa Pig theme park inside a Shanghai shopping mall. Two more Peppa Pig World of Play attractions have opened this year in the US, with plans for dozens more, including in New York and Beijing.

Meanwhile, in England, Peppa Pig World, which opened in 2011 at a Hampshire theme park, attracts legions of snorting four-year-olds. “It did kind of feel like I was in her world,” says Betsy Ellis, a recovering Peppa superfan, who is now seven. Her father, Rob, remembers being stunned by the adoration he witnessed during his first visit to the park, where the insanely catchy theme tune plays on a loop. “Peppa stood on a stage and people handed their kids up to her,” he says. “It was like meeting the Pope.”

How did a strangely drawn pink farm animal became so wildly popular – and profitable? The story starts with a little girl called Lily, the daughter of animators Alison Snowden and David Fine. The couple were old friends of Baker, who had begun working with Astley in the early 90s. People were still painting by hand on to celluloid sheets then. “We’d learned from books written by the old Disney animators,” says Baker.

Astley and Baker wanted to create a cartoon series that would have the same charm as shows such as The Magic Roundabout, which they had watched with their parents in the long-gone slot before the BBC evening news. But hand-drawn animation was notoriously laborious and many studios were outsourcing work to eastern Europe. When Astley and Baker set up shop with Davies, they embraced new computer technology in a way that meant they could think big while staying small.

Facebook Twitter Pinterest Global reach … a Rice Field In Huangshan, China, with an image of Peppa Photograph: VCG/VCG via Getty Images

The friends thought they had made it when BBC Worldwide funded The Big Knights, an animated series about two hapless, overweight soldiers. It won awards, but the BBC shunted it around the Christmas schedules in 1999 and it didn’t stick. “At a meeting about a second series, Nev pointed out that they were talking about the show in the past tense,” Baker recalls. “After all that work, it was gone.”

Distributors and broadcasters were still looking for the next big thing after the success of Bob the Builder and the Teletubbies. “We gave ourselves a week to come up with ideas,” Astley says. What children lacked, they decided, were everyday stories about families. When executives told them children didn’t like watching adults, conversations with Alison gave them succour. Baker recalls: “She said that when she read stories to Lily, she’d often ask: ‘Where’s the mummy and daddy?’”

The family idea came first, and then the girl protagonist – another glaring gap in the market. Next came the snorts, which, the animators hoped, children would enjoy copying in playgrounds. Snorts led naturally to pigs, and mud, and Peppa’s house on a hill. “We gave her the red dress and the name, which is sort of hot and spicy, because we wanted her to be a bit edgy and have character,” Baker says.

The trio sent a trailer to TV executives, but notably not the BBC after their Big Knights experience. “It didn’t go anywhere,” Baker says. “We’d go round to depressing meetings where they’d give us all the reasons why it couldn’t work. We pretty much gave up.”

There were concerns about Peppa’s two-dimensional face, which is shaped a bit like a hair-dryer, with both eyes on the same side. The design meant that even in profile the pig could show a full range of expressions, but it limited her merchandising potential. “To get funding, you had to make something in 3D so you could put it on a shelf and sell it,” Davies says.

Layla Lewis was at the meeting that rescued Peppa. She was managing acquisitions for Nickelodeon at the time and had enjoyed the trailer. “I remember walking into the room and I don’t think I even said ‘Hi’,” she recalls down the line from New York, where she now works. “I just snorted and we all laughed out loud like they do in the show.”

Early sketches for Peppa PIg. Photograph: PR

Contender Entertainment, Peppa’s first distributor, put up some of the funding, along with Nickelodeon and Channel 5, which showed Nickelodeon content on its Milkshake strand. But there was still a £400,000 shortfall that the animators had to beg and borrow themselves, not drawing salaries for months. “If we hadn’t got it made, we were going to have to find a different way to make a living,” Baker says.

The trio had just over a year to dream up and animate 52 episodes of Peppa Pig. Without children of their own (Baker and Davies now have a teenager each), they returned to Lily. Alison would tell them about the funny things her daughter had done, inspiring many of the episodes’ themes (the first series included “Best Friend”, “Hide and Seek” and “Pancakes”). Lily was four when casting began and had a sweet voice, so she got the role of Peppa.

“I remember sitting in the recording room and, since I couldn’t read, Mum would read the lines to me and I would repeat them,” Lily Snowden-Fine says from Toronto, where her family moved when she was eight. (Peppa has been voiced by two other girls since the first series.) Lily is now 21 and has a Canadian accent, but with traces of Peppa. “I remember her getting quite irritated because I’d bang on a chair and we’d have to do it again, but she’d still give me half a doughnut at the end of the day.”

It was only as a teenager that Lily, who is now an illustrator, realised she had become a strange sort of star. “I started getting messages on Instagram: ‘Are you Peppa, are you Peppa?!’” she says. “Friends will find out and ask me to do the voice. It was this little show that happened as part of my life and now the whole world knows about it.”

I recently showed Peppa to my son Jake. He is 19 months old and doesn’t understand the stories, but he cackled and bounced with excitement when the pigs first jumped in a muddy puddle. He has never been so excited in front of a screen and now routinely points at the TV and demands “Peeeg?! Peeeg?!” He points to Mummy or Daddy Pig and shouts “Mama!” or “Daddy!”

Peppa Pig is smarter than it looks. “It’s beautifully written,” says Greg Childs, a veteran director and producer at CBBC and CITV. “But it also deals with family, which is the first thing that makes sense to children. It meant it could capture them quite young.”

Facebook Twitter Pinterest A Peppa Pig book display at Waterstones, London. Photograph: Kumar Sriskandan/Alamy Stock Photo/Alamy Stock Photo

The plots, where they are understood, are carefully crafted. “When I teach script structure, we look at Peppa Pig, because it manages to get a simple three-act structure into a five-minute episode,” says Sarah Kennedy, who teaches animation at the University of Central Lancashire. She wrote two episodes in the first series, and is the voice of Miss Rabbit, who has appeared variously as a shoe-shop owner, firefighter and pilot. The formula means setting up a story in act one, creating a seemingly impossible problem in act two – and solving it in act three. “Someone always saves the day,” says Betsy Ellis.

Peppa Pig won fans, plaudits and – eventually – a second series, which was all Astley, Baker and Davies wanted after the Big Knights failure. The rest is history, but the trio didn’t expect what followed. As well as the spider problem, there was the absence of seatbelts or bicycle helmets in early episodes. Doctor Brown Bear, a recurring character, encouraged “unrealistic expectations of primary care” because of his out-of-hours calls for trivial illnesses, a real-life GP wrote in the British Medical Journal.

“We were being picked up on everything,” Astley says. He remembers the seatbelt complaints. “I was thinking: ‘Well, Noddy flies around in a plane without one!’” Even so, the team went back and added seatbelts and bike helmets. Baker says they thought carefully about gender from the start. Peppa’s dress is red, not pink, and there is an early scene in which Daddy Pig makes soup while Mummy Pig works upstairs. “It got harder, because people began to see it as a representation of the whole world, rather than just a stylised microcosm,” he says.

The show now exists in an ever more fragmented TV industry, and in the wild west of YouTube, where spammers have made fake Peppa films with less wholesome themes (in one, that YouTube deleted, she was tortured by a dentist). In China, a rash of subversive Peppa memes circulated by young netizens has triggered high-level handwringing; after one video site deleted thousands of clips, a state-run newspaper attacked the “unruly slackers” who were “the antithesis of the young generation the [Communist] party tries to cultivate”. But the show has also embraced the internet; Peppa’s official YouTube channel has more than 8 million subscribers and 3bn views.

Facebook Twitter Pinterest Peppa Pig… three-act perfection in five-minute episodes. Photograph: five

In 2007, Canadian media giant Entertainment One (eOne) bought Contender, Peppa’s distributor. In 2015, eOne then bought 70% of Astley Baker Davies for £140m. The animators were the sole owners of their company, and still also get 5% each of a very large royalty pie. Peppa merch has grown to include the usual lunchboxes and duvet covers, but also Heinz pasta shapes, Yoplait yoghurts and Vitabiotics multivitimains. Yet here they are, not on a pink yacht in Monaco, but dressed in jeans in a little office. “Suddenly to have the option to retire was very odd,” Baker says. The trio continued out of loyalty to their staff, their audience, but also to Peppa. They recognised – with a sense of mild horror – that the show would go on without them; the pig was bigger than them.

Each man remembers pinching himself at some point during Peppa’s rise. Astley shows me an old photo of them gleefully visiting Argos when the first toys went on sale. He says going to Peppa Pig World in 2011 felt like “being a young Walt Disney”. “It was like a mad dream,” Davies adds. For Baker, it was marvelling at whole shelves of Peppa books, knowing that he had had no direct involvement in their creation.

Has Peppa changed kids’ TV? “I think it’s one of those global phenomena which come up about once every 10 years,” Childs says. “But if Peppa has done anything, it’s to remind us that there is no substitute for great writing.”

As my son discovers the show, Betsy Ellis, the former superfan, has moved on to other things, including a YouTuber who plays Minecraft while millions of viewers watch. She is still fond of the pig and wonders what lessons children might take from the show. Her thoughts might also apply to Astley, Baker and Davies, and their fight to get it made 15 years ago. “There’s always a secret message behind each episode, and it’s normally, like, ‘Never give up’ or ‘Keep on going and see what happens’,” she says. “Or, sometimes: ‘You have to be a little bit cheeky to get the things that you need.’”