There is an episode in the first season of Broad City – the US sitcom about two twentysomething, weed-loving best friends – that involves an epic journey to pick up some post. In order to track down a parcel, co-protagonist Abbi must travel on an eerily empty subway before boarding a ferry populated solely by identical twins. Finally, she arrives at a cavernous warehouse, where a demon-voiced, yoghurt-smeared old lady called Garol refuses to hand over the package, sternly informing the now desperate Abbi that she does not possess the requisite ID.

Frenetic and weird, this tale of lost mail possesses quintessential qualities found in Gen-Y comedy: it is unsettling (Garol’s warehouse belongs in a horror film); it is absurd (Why all the twins? Why all the yoghurt?); and it is soundtracked by a scream of millennial angst. If 1990s sitcoms were characterised by sexually liberated pals cracking wise, and the 00s by docu-realist, workplace-based cringe comedy, this decade has been dominated by the sadcom, a strain of comedy-drama shuddering under the weight of personal hardship and the idea that actual jokes are largely unnecessary. But as the 2010s come to a close, a new wave is establishing itself: one that retains the sadcom’s essential bleakness, but overlays it with surreal settings, chaotically strange plotlines and jokes that ring with an erratic absurdity.

If you wanted to trace the roots of this simultaneously silly and slightly alarming comedy, you’d likely find yourself at the door of Adult Swim, the US network that has distinguished itself with programming that is startlingly, sometimes horrifyingly, absurd. What started with Tim and Eric Awesome Show, Great Job! – a disorientatingly awkward sketch show with deliberately poor production values – has flowered into a whole tonal universe. Latterday hits include Rick and Morty, The Eric Andre Show and Andre’s new series, Mostly 4 Millennials.

In recent years, this comic sensibility has infiltrated the mainstream. On Netflix, a similar – if less outrageous – sense of unsettling weirdness reigns. I Think You Should Leave With Tim Robinson is an assemblage of aggressively odd scenarios; BoJack Horseman explores trauma through the medium of a cartoon horse; while The Good Place combines wildly imaginative settings with both profound darkness (a quest to avoid literal hell) and untold silliness. A raft of web comedies push the genre even further: Kate Berlant and John Early’s 555 combines eerie ridiculousness with bad special effects; cult kids’ TV spoof Don’t Hug Me I’m Scared blends cryptic imagery and body horror; and Year Friends – created by comics including Liam Williams and Jamie and Natasia Demetriou – features shoddy computer graphics and bad-dream storylines about death and pregnancy.

How did millennial comedy end up so disorientating, dark and strange? One explanation for all this un-realism is that it’s a response to a world that has stopped making sense. Philosophical absurdism argues that the universe is inherently irrational – a perspective rendered particularly apt by the unpredictable political developments of the past few years. But there’s something unique about millennials’ lot that contributes to this sense of meaninglessness. In 2017, the Washington Post asked: “Why is millennial humor so weird?”, positing the theory that as the economic climate has delayed milestones such as marriage, kids and home ownership, and external sources of meaning such as religion have faded away, life has started to feel unpleasantly rootless, something that is being reflected in a stranger, more chaotic form of comedy.

Abbi Jacobson, who plays her namesake in Broad City, says the sitcom was partly informed by the precarity and sense of helplessness that she and co-creator Ilana Glazer experienced as young adults living in New York. “One of the first absurd moments that I can think of – and it was a pattern we did throughout, which we called a ‘pop-out’ – is a bank scene where my character does an illustration and makes $8,000,” she says. “So when we walk into the bank it’s in slo-mo; I’m dressed in that homage to Missy Elliott.” That wild response to having a decent amount in your account speaks to the insecurity that is the defining feature of Abbi and Ilana’s lives, something that leads to extreme emotional peaks and troughs. “Big things that happened in our lives that were incredible or really hard lent themselves best to these pop-outs,” says Jacobson. “That’s where the thesis of our absurdity would come from, it’s us amplifying how we feel in that moment.”

Facebook Twitter Pinterest The Eric Andre Show. Photograph: Tyler Golden/Adult Swim

This sense that the world is constantly, and violently, shifting echoes the feel of the internet. Some shows reflect cacophonous social media timelines where inanity, tragedy and banality are all jumbled up together. According to Andrew DeYoung, director of 555 and one-time editor on The Eric Andre Show, the Adult Swim school of comedy is designed to “reflect the frenetic distribution of information on the internet – that’s why a lot of their shows are so chaotic and absurd.”

Yet the internet has also revolutionised humour on a molecular level. Online, comedy has been evolving in double-time, twisting itself to fit the demands of the medium – namely its insatiable desire for immediate, easily digestible content. Gags designed to spread on social media are often single images, 140 character quips or seconds-long snippets of film. “A lot of comedy stuff that goes viral is very short and decontextualised – it’s just a five-second clip of something very strange,” explains Brett Mills, senior lecturer at UEA and author of The Sitcom. “It’s that idea of narrative disappearing.” While this new wave of TV comedies often cleave to narrative tradition in one sense (they follow the same characters over some kind of developmental arc), they also play with linear storytelling – messing with the concept of time itself in The Good Place, Russian Doll and Rick and Morty or deploying deliberately disjointed editing (as seen on The Eric Andre Show, Year Friends and Don’t Hug Me I’m Scared).

Not only is there no time for narrative online, there is rarely room for the traditional set-up/punchline structure either. Instead, things are funny because they are wilfully jarring and strange. You can see it in intentionally bizarre “dank memes” and the catastrophically misguided missives of Weird Twitter. Sometimes, decontextualisation is the joke itself, as “no context” Twitter accounts prove. Elsewhere, there is a contrived randomness. Gabriel Gundacker made his name on now-defunct platform Vine – home of the six-second video and internet comedy powerhouse. He says Vine’s looping feature led him to realise “you needed a twist at the end that people come back to. The punchline for me was often free association: what is nearby? What’s the last thought I had?” Gundacker now writes for TV, and says “that random element” is something he tries to maintain.

It’s this illogical, inexplicable humour that makes much of this new wave of TV comedy feel novel and slightly subversive. In May, Vice ran an article titled I Think You Should Leave Is Like Weird Twitter as a TV Show, with the series’ excessively scattergun approach in mind. Other programmes, meanwhile, are incorporating this decidedly random strain of humour, unfettered by traditional joke logic, into their longer-form setups. It is why “Garol” is funny, and why she is covered in yoghurt. It’s why in Year Friends, there is a character who for some unknown reason cannot go up stairs. It is why in The Good Place, friendly demon Michael describes afterlife time as following the “Jeremy Bearimy” model (as in, the timeline looks like the words Jeremy Bearimy – there is no other reasoning behind it).

Clearly, this kind of comedy can be highly subjective. The impetus to “get” the joke where one does not actually exist has the potential to alienate viewers. “Stuff that I see in [lip-sync app and Vine heir] TikTok, because it’s so strange, would make someone like me laugh but not affect another person at all – they’d see it almost as video art,” says DeYoung.

Joseph Pelling notes this quality in his web series Don’t Hug Me I’m Scared. “Some people might find it funny and some people might find it genuinely disturbing. I can’t tell what the line is.”

As those on the right wavelength (and, perhaps, in the right age bracket) will know, however, internet-shaped humour is also characterised by a straightforward silliness, machine-tooled to pierce the panic-inducing online news cycle. TV comedy is beginning to tread a similar line – mixing disruption with mindless humour to cathartic effect. Pelling describes himself as a “big fan of David Lynch but also just stupid voices”. Jacobson says that she is proud Broad City “was always funny first” at a time of sadcom domination. Between the TV landscape and disaster politics, this return to ridiculousness feels refreshing and necessary: by turning up the volume of the chaos of modern life to ear-splitting levels, millennial comedy has found a way to cut through the noise.