Before settling on “Homelamb” as the punny title for a parody of the hit Showtime series, veteran “Sesame Street” scribe Belinda Ward toyed around with many iterations, none of them quite right.

“‘Homeland’ was a very interesting writing process,” says Ward. “We went through every possible thing.”

“She kept calling me because she desperately wanted to do a ‘Homeland’ thing,” recalls “Sesame” head writer-cum-puppeteer Joey Mazzarino, who also co-wrote the screenplays for “The Adventures of Elmo in Grouchland” and “Muppets in Space.” “She goes, ‘What about ‘Combland?’ It’s about somebody that can’t brush their hair.’ And I said, ‘I don’t know about that, Belinda.’ And then one day I was running and I was like, ‘Wait, we’re looking at the wrong part of the word.’ So I called her from the track and said, ‘Belinda, what about “Homelamb?”’ She was like, ‘That’s it!’ ”

With its grainy opening credits set to moody jazz chords and its collage of “sheepish” characters — a bleating “Caa-rie Mathison” suspects “Nicholas Baa-rody” is the Big Bad Wolf — the ovine-themed send-up became an online juggernaut, garnering over 1 million YouTube hits. The viral sensation is just one of their spot-on (and occasionally arch) spoofs, a theatrical treasure chest of uproarious bits that includes “Hungry Games” (no kids were killed during this G-rated version of the trilogy), “A’s Anatomy” (Dr. Grover is a bespectacled alphabet specialist) and “Desperate Houseplants” (neglected potted greens long for sunlight and water).

It’s this clever commingling of adult-oriented pop culture with preschool humor that has not only made “Sesame,” which will celebrate its 45th anniversary in September, one of the most heavily decorated series in Emmy history — to date, it has won eight Primetime Emmys and 108 Daytime Emmys — but also a beacon of excellence in comedy.

“We all think of ourselves as comedy writers first,” says Mazzarino. “We don’t think of ourselves as children’s writers. We obviously know how to write for kids and really care about that, but we want to make it funny first and foremost.”

“We all have a very similar comedic sensibility,” notes Ward of the writing staff. “I don’t think any of us thinks about writing for children as much as you think about what makes you laugh and what’s the funniest idea. And then you find a way to make that idea simple enough for kids. Kids are people, after all.”

Since “Sesame’s” debut in 1969, Joan Ganz Cooney and Lloyd Morrisett’s magazine-style format has employed some of the sharpest and most gifted writers in the biz, from Jon Stone (who penned the pilot script) to the legendary Jim Henson to Carnegie Medal-winning “Knuffle Bunny” author-illustrator Mo Willems. Along the way, these and other top scripters have crafted such jocular smallscreen moments as the classic Abbot and Costello-inspired “Ernie Can’t Sleep” sketch (insomnia has never been so hilarious) to the near-trippy “The Martians Discover a Telephone” segment. And with a steady stream of high-profile celebrities continuing to clamor for cameos on the show — each season, casting directors have to turn away inquiring A-listers — there’s a mountain of potential comic material with which to work.

Whether it’s lampooning a top-40 song (Carly Rae Jepson’s peppy anthem “Call Me Maybe” became a clarion call from Cookie Monster to “Share It Maybe”) or a skit in which Elmo and Seth Rogen (balancing a wedge of French-speaking cheese on his head) explain the word “embarrassed,” the comedy is sophisticated, beneficent and encourages, per executive producer Carol-Lynn Parente, “dual engagement” viewing in both parents and the pint-sized set. So popular are these parodies that when one skewing “The Voice” aired, sans Adam Levine, the jilted Maroon 5 frontman took to social media in mock protest.

“The characters are so rich and amazing so people just fall in love with them,” says writer Christine Ferraro, “but they also love that (the show) is written on two levels, with a universality that works for 2-year-olds, 22-year-olds and 42-year-olds.”

But as Ward notes, getting to that comic sweet spot isn’t always a painless process.

“I wrote the ‘Sons of Poetry’ parody — about a gang of motorcyclists who help people with poetry — which was based on ‘Sons of Anarchy,’ ” she says. “Have you ever seen that show? At least for women, it’s like a horrible thing. It’s very violent. I also had to watch ‘Twilight’ to write ‘Twilight: Breaking Cookie.’ It’s so bad. The worse they are, the easier they are to parody.”

But when the accolades reaped are plentiful, and from such venerable industry players as Mindy Kaling, Christina Aguilera and Matthew Weiner, who asked to buy the Muppets used in the “Mad Men” parody (which charted their mercurial ups and downs) then it makes it all worth it.

“I think if you watch a lot of what’s on in the preschool market, for the most part they’re sort of generic kids shows that don’t have the kind of comic obsession that our show does,” says Mazzarino. “What we’re doing is truly unique in that way. It’s an incredible place to work and everybody’s always excited to be here. I am the luckiest person in the world.”