History’s greatest bar joke didn’t come about from a man walking into one, but from a couple of kids calling one on the phone. In the mid-1970s, two New Jersey youngsters decided to prank call a local tavern, over and over. And over. And over. The recurring gag was getting a rage-prone bartender named “Red” to ask after imaginary patrons with names like “Ben Dover” and “Phil Layceio” (say it out loud). The setup was lame, but the star of the tapes was Red, whose gravelly voiced, unhinged threats of violence were as hilarious as they are still unprintable, 40 years later. The Tube Bar Tapes soon spread through suburban basements, smoke-filled dormitories, and comedy club back rooms, prized jewels in the underground economy of weird lowbrow Americana. (By the 1980s the tapes were allegedly fixtures of many Major League Baseball clubhouses.)

By the time The Simpsons premiered in late 1989, the Tube Bar Tapes were already a classic of their kind, but Matt Groening and his writers made them immortal. The character of Moe Szyslak, the bellicose, put-upon barkeep whose unsightly mug first appears in the show’s premiere, “Simpsons Roasting on an Open Fire,” was Red rendered in cartoon form, the ongoing object of Bart Simpson’s slightly more clever and far more TV-friendly fake-name pranks—“Oliver Klozoff,” “I.P. Freely,” “Seymour Butz.” From his very beginnings, Moe was a winking “stop me if you’ve heard this one before,” an avatar for a shadow history of left-of-the-dial comedy, an Easter Egg for connoisseurs of things that don’t deserve connoisseurship (which are the only things that matter anyway).

And then he became so much more. The Simpsons has created so many incredible characters that choosing a favorite is unpossible, but Moe owns a special piece of my sclerotic, elf-powered heart. In the past quarter-century, Moe has loved and lost (multiple times), nearly struck it rich (again, multiple times), become a fight promoter and a soap-opera star, converted from snake-handling to Santeria, briefly enjoyed his own spin-off, and incessantly attempted suicide. There are several entire episodes devoted to his own physical repulsiveness, which is exceeded only by his spiritual repulsiveness. His docket of transgressions includes insurance fraud, exotic animal trafficking, bootlegging, facilitation of blood sports ranging from Russian Roulette to monkey knife-fights, and a host of what Troy McClure might call “romantic abnormalities.” And yet, he has become as unforgettable a character as any forged in the show’s 25-year run, beloved in spite of himself by the denizens of Springfield and the generations who’ve watched them.

The story of Moe—his oddball beginnings, his pugnacious heart, his rages and joys and astonishing depths—is, in many ways, the story of how The Simpsons went from being a catchphrase-laden pop-culture supernova to one of the most influential cultural works of the late 20th century. The most important decision The Simpsons ever made in its early years was to reimagine itself out of being a show about Bart Simpson into being a show about Homer Simpson. Through this transition—which happened so seamlessly that it was barely even noticeable—The Simpsons moved from being a show about a mischievous kid and his genially dysfunctional family to being a show about an idiotic everyman let loose on the world. In other words, it grew from the best satire of sitcom families in the history of television into the best satire of everything in the history of television.

The first episode in which Moe is featured as a main character, the Season 3 classic “Flaming Moe’s,” comes squarely in the middle of this shift. “Flaming Moe’s” is a Homer episode through and through: Homer introduces Moe to an uncannily delicious drink recipe, Moe steals it, the two men have a falling out, then finally reconcile once everyone’s dreams have been dashed and they’re somehow all the better for it. “Flaming Moe’s” established the key elements of Moe’s character: down-and-out, desperate, morally bankrupt until finally he’s the opposite. This trajectory would be rinsed-and-repeated in nearly all of the show’s most memorable Moe-centric episodes: “The Homer They Fall,” “Dumbbell Indemnity,” “Pygmoelian,” “Homer the Moe,” and “Moe Baby Blues,” to name just a few.

To a certain degree, the moral anarchy that follows Moe can be linked to The Simpsons’ treatment of alcohol and alcoholism, which cuts deeper than any TV comedy besides Cheers. The show’s fictional beer, Duff, is now as iconic as any of the mass-produced schlock brews it parodies, and there have been several episodes devoted to characters’ attempts to stop drinking. The show’s resident drunk, Barney Gumble, dried up for nearly three seasons before unceremoniously falling off the wagon in Season 14. Springfield even enjoyed a brief flirtation with prohibition in “Homer vs. the Eighteenth Amendment,” which features perhaps the greatest line about booze ever written: “To alcohol! The cause of—and solution to—all of life’s problems.” As Springfield’s premier purveyor of spirits, Moe is a metonym for the beverages he serves and the quandaries they produce, a murderous lunatic one moment and an aw-shucks sweetheart the next, everyone’s most dogged antagonist until he’s their most trusted friend.

But the show also needs him, desperately, in the same way that many of us often need a drink. The great miracle of The Simpsons is that a show whose satire is so razor-sharp is also, at its core, remarkably sweet: It is a deeply uncynical show that feels like it’s made by people acutely aware of the world’s capacity for cruelty. But that darkness needs a release, lest it explode onto the show’s surface: If every episode was “Homer’s Enemy,” the show would be unwatchable.

This has been the heroic genius of Moe, his peerless capacity as safety valve for the release of cruelty. The level of abuse the show has heaped upon him over the years is astonishing: the lie detector sequence from “Who Shot Mr. Burns, Part 2” plays like a depraved Abbott and Costello routine, and is one of the funniest bits in the history of the show. The closing sequence of “Grift of the Maji” includes a shocking, out-of-nowhere visual of Moe in his dingy kitchen clad in underwear and socks, sticking his head in an oven with a “NO FUNERAL” sign taped to his back. And somehow it’s hilarious, and Moe is redeemed as always, this time through nothing less wholesome than a Christmas miracle wrought by Gary Coleman and a bonfire of psychotic toys.

Twenty-five years ago, The Simpsons changed the face of television, an animated sitcom for adults with no laugh track that sent up the American nuclear family with bone-deep wit and oddly profound affection. When it first began, it was easy to think of the show as Bart, the cowabunga dude pranking the world. Then it grew into something even bigger than Homer at his biggest. But the most wonderfully dark corner of its soul has always belonged to Moe: angry, sad, desperate, hilarious, perfect.