In a 2012 poll conducted by 60 Minutes and Vanity Fair, Seinfeld was voted the greatest American sitcom of all time, edging out tough competition from the likes of The Honeymooners, Friends, Cheers and Arrested Development. The “show about nothing”, created by Larry David and Jerry Seinfeld, ran for nine seasons from 1989 until it ended in 1998, but clearly still lives large in US viewers’ consciousness. So too does Friends, which has just turned 25 and is still the subject of formidable bidding wars between streaming services hungry for the re-run rights.

More like this

-       A teen reimagining of House of Cards

-       How Friends changed our idea of family

-       The best TV shows of 2019 so far

However, there is another show about a group of quirky friends living in one of the US’s biggest cities that has quietly become a phenomenon in their wake. It eschews both the middle-class minutiae of Seinfeld, and the will-they-won’t-they romances of Friends – in favour of crystal meth, kitten mittens, and accidental kidnappings. In the process, It’s Always Sunny in Philadelphia has become the best sitcom in the US, tackling everything from gun reform to Time’s Up with an irreverent, unmistakable lens. It’s also become one of its longest-running – this week the show returns for a historic 14th season, a feat only matched by the rather more wholesome 1950s classic The Adventures of Ozzie and Harriet.

The show comes from humble beginnings. It was initially conceived as a short film after its stars and co-creators Rob McElhenney, Glenn Howerton and Charlie Day met in Los Angeles, where they were all out-of-work actors trying to catch a break. The concept was simple – as Howerton explained to the New York Times in a 2007 interview, it was to focus on “a group of friends who care so little for each other”.

Utilising their inordinate amount of free time as unemployed thespians, they cobbled together a pilot episode, shot on a digital camcorder with no budget. After shopping their homemade DVD to various networks, it was enough to convince Fox subsidiary channel FX to give them the go-ahead for a full series. But while the per-episode budget of $450,000 was a considerable improvement on nothing, it was still less than a third of the network standard, positioning the show as an underdog right from the off.

A divisive start

Following slight tweaks from its pilot iteration, It’s Always Sunny in Philadelphia was born, centring on a group of terrible friends who run Paddy’s Pub together: Charlie (Charlie Day), Mac (Rob McElhenney), Dennis (Glenn Howerton) and his sister Dee (Caitlin Olsen).

The same year, CBS premiered How I Met Your Mother, and NBC’s remake of The Office first aired. The general tone of sitcoms of the period was considerably lighter and less risqué than It’s Always Sunny: in the first season alone, topics covered included underage drinking, cancer, and gun control. Against the backdrop of a cautious, post-9/11, second-Bush-term US, the show was a breath of fresh air.

It is smug enough to think it’s breaking ground, but not smart enough to know it isn’t – Gillian Flynn

However, despite garnering largely positive reviews, not everyone was a fan; in a 2005 review for Entertainment Weekly, Gillian Flynn – who would go on to become the best-selling author of Gone Girl and Sharp Objects – said “it is smug enough to think it's breaking ground, but not smart enough to know it isn't”. It also struggled in the ratings, and so McElhenney and co were instructed to add a big-name star to the cast for the second series in a bid to improve its performance. Thus came Danny Devito, cast as Dee and Dennis’s rich absentee father, Frank.

It would be remiss to suggest that the rest was history, and that It’s Always Sunny hit its stride purely because of the addition of one of Hollywood’s most recognisable stars to its main cast – but certainly the cultural cache that Devito brought helped the show become a cult hit. It achieved particular popularity with university students, especially those based in Philadelphia (although almost all of the show is shot on soundstages in Los Angeles). In 2008, Jonathan Storm of The Philadelphia Inquirer described the show as “like Seinfeld on crack”, which FX adopted as a tagline.

While many other sitcoms have come and gone, amid the rise of prestige television, this scrappy underdog has quietly continued to develop its cult following. With shorter seasons than standard American sitcoms – each averaging 13 20-minute episodes – and a deceptively simple premise, it continues to buck trends.

Even though the show is an unapologetically US beast, perfectly transitioning from Bush to Obama to Trump-eras during the course of its impressive run, it’s found a uniquely dedicated fanbase around the world too: overseas, Comedy Central and Netflix have been instrumental in connecting global audiences with the strange world of Charlie, Mac, Dee, Dennis and Frank.

In the UK, It’s Always Sunny quizzes and fan nights have been springing up, with fans gathering to test their knowledge, recreate some of the show’s iconic moments, or simply watch a bunch of episodes in a communal space. Michael Hall works in programming and outreach at East London’s Genesis Cinema, where It’s Always Sunny nights in their bar have become a mainstay. “We have games of Flip-Cup, themed cocktails, we deck the bar out with Paddy’s signs – we've even had live music. Hearing a hundred people sing along to a wordless theme tune is a surreal joy,” he explains. 

The secret of its success

So how to explain its ever-growing appeal? Part of it lies in its singularly nihilistic tone. Given the uncertain social, political, and literal climate of 2019, it makes sense that a comedy which delights in human misery would resonate with audiences so deeply. “I started watching It’s Always Sunny in Philadelphia on DVD during the hazy period between the end of high school and the beginning of college,” recalls culture writer Dan Schindel, a Maryland native now based in New York. “Given the constant precariousness the characters find themselves in, I think it makes sense that it would appeal to me in such a time of my life. And then later I graduated college and it turned out our times would be marked by constant precariousness, so the show would never not be apropos!”

It’s managed to make great points on race and sexuality despite giving off the appearance of being a moral void - Michael Hall, organiser of It’s Always Sunny nights

That nihilism is matched by a refreshingly cynical approach to characterisation. While the leads in other sitcoms mature over time, ‘The Gang’ only seem to become more unpleasant. There are no life lessons – instead, in the vein of Seinfeld’s famous “no hugging, no learning” mantra, pathos is often eschewed in favour of escalating hijinks.

In actual fact though, it has more depth than its scuzzy surface would suggest. As Hall says “there’s a feeling of freedom to a show where everyone is a scumbag” – and with that freedom “it’s managed to make great points on race and sexuality despite giving off the appearance of being a moral void.” It unapologetically skewers hot-button subjects most shows dance around. In its very first episode, ‘The Gang Gets Racist’, for example, Charlie attempts to prove to the woman he is in love with that he is not racist by seeking out black friends. While in its recent 13th season, ‘Time’s Up For the Gang’ saw the Sunny crew try to address sexual harassment in the workplace, after being placed on a ‘Worst Bars List’ – with predictably disastrous results.

Meanwhile, it has found artistic inspiration in a range of likely and unlikely sources, from classic comedy fare such as The Three Stooges to Paul Thomas Anderson’s The Master and Daniel Keyes’ sci-fi novella Flowers for Algernon. Incidentally, last season McElhenney and co paid tribute to Seinfeld episode The Contest in ‘The Gang Does A Clip Show’, indicating a fondness for their revered predecessor. But while Jerry, George, Elaine and Kramer were, by and large, decent, upstanding members of society, Charlie, Mac, Dee, Dennis and Frank are their looking glass counterparts: damaged, difficult emblems of awfulness.

It also has come to show real heart, unexpectedly – as in ‘Mac Finds His Pride’, the final episode of It’s Always Sunny’s 13th season, in which Mac decided to come out as gay to his father, a stern, uncommunicative felon. In a piercing, beautifully-choreographed set piece, McElhenney executes an emotional piece of modern dance, while Danny Devito’s Frank looks on in amazement. “Now I get it,” he whispers, tears forming in his eyes. 

After so long on the air, there is of course a question over whether It’s Always Sunny can continue to keep things fresh. With a show as sharp-toothed as this, it’s crucial that it retains its bite. Nevertheless breaking the “No hugging, no learning” rule every once in a while is no bad thing. The jokes still range from pleasingly juvenile to bafflingly surreal, and the tone seems as sardonic as it ever was, but there’s some warmth too – and after 14 years, It’s Always Sunny has earned it, as well as a place in the comedy Hall of Fame.

Season 14 of It’s Always Sunny in Philadelphia premieres on the FXX channel in the US on 25 September

Did you enjoy this story? Then we have a favour to ask. Join your fellow readers and vote for us in the Lovie Awards! We're nominated for Best Website - Television & Film and Best Overall Social Presence. It only takes a minute and helps support original, in-depth journalism. Thank you!

Love TV? Join BBC Culture’s TV fans on Facebook, a community for television fanatics all over the world.

If you would like to comment on this story or anything else you have seen on BBC Culture, head over to our Facebook page or message us on Twitter.

And if you liked this story, sign up for the weekly bbc.com features newsletter, called The Essential List. A handpicked selection of stories from BBC Future, Culture, Worklife and Travel, delivered to your inbox every Friday.