Halfway through Parasite, Bong Joon-ho’s Oscar-nominated film, the story moves in an unexpected direction. A wealthy family’s ex-housekeeper returns to their home after being laid off, much to the chagrin of the current housekeeper, keeping watch while its owners are on holiday. The former housekeeper begs to be let in, explaining that she has left something in the basement. Hats off to anyone who predicts what that something is.

The camera snakes its way along a disguised stairwell, revealing her forgotten cache to be … her husband, hidden in a concrete bunker deep beneath the house. Evading creditors who might kill him, he has lived below ground for years, trapped in subterranean austerity and subsisting on food his wife sneaks down to him.

It may sound like an eccentric plot device, or perhaps a heavy-handed metaphor for wealth inequality. Yet it’s not the only recent film to portray a hidden underclass living below ground. In March last year, Jordan Peele’s Us arrived in cinemas, a hotly anticipated follow-up to his 2017 masterpiece Get Out. Trusting in his audience’s taste for complexity, Peele swapped the relatively straightforward bodysnatchers premise of his debut for something even stranger: depicting a deranged army of clones (“the Tethered”) who escape from an underground complex and seek out their surface-dwelling counterparts.

Online forums swelled with discussion of the film’s imagery as puzzled cinema-goers sought to unpick its allegorical threads. As with Parasite, social class and its hold on our imagination is central, but what requires explanation is how two film-makers, working in different countries, could release films in the same year, united by such a specific thread.

Out of the depths … Lupita Nyong’o in Jordan Peele’s Us. Photograph: Alamy

The idea that the damned might live below the Earth is an ancient preoccupation. Across cultures, different mythologies have dreamed up fables of an underworld to accommodate the souls of the dead. The idea of hell found in the Abrahamic religions maintains a line of imagination dating back, at least, to Hades in ancient Greece. Although arguably, it was Dante’s Divine Comedy that helped to formalise the association of financial failure and those doomed to exist beyond the reach of the sun.

In the Inferno, he travels down to hell, discovering in the fourth circle the greedy who hoarded their wealth and life’s debtors, with an equally grim fate reserved for both. Some centuries later, Dante’s carefully gradated circles of hell and redemption mirror our own hierarchical obsessions, visible in league tables and the highest-to-lowest function of spreadsheets and e-commerce websites.

If Dante popularised the idea of a literal underclass, it was carried into the realm of science fiction by HG Wells. In The Time Machine (1895), Wells imagines the human race dividing genetically along the lines of social class, with manual labourers developing into the troll-like Morlocks, who emerge from tunnels in the dead of night to kill and devour surface-dwellers. In Wells’s story, the inequalities of Victorian society are magnified until they become obscene.

Time and again, an imagined world below the ground has functioned as a repository for our collective anxieties. During the cold war, the film Beneath the Planet of the Apes (1970) imagined what would remain of humanity in the wake of nuclear disaster: surviving below ground as a persecuted mutant race, worshipping an unexploded bomb.

For film-makers, the association between things we wish to repress and a physical topology is fertile ground, especially when looking to shock or provoke. In his documentary The Pervert’s Guide to Cinema (2006), philosopher Slavoj Žižek unpacks that quintessential house of horror: the Bates family home in Psycho (1960). Set across three levels, he argues, the house is a stand-in for Freud’s tripartite structure of the mind. On the ground floor, Norman is careful and well-mannered (as with our conscious ego), the hectoring voice of his mother emerges from the first floor, representing the cruel superego of our inner monologues. It’s no surprise that the decaying corpse of Mrs Bates is discovered in the basement, the home of our silent, primal desires: the id.

On the periphery … Almodóvar’s Pain and Glory

Not every association is metaphorical, of course. In Pedro Almodóvar’s Pain and Glory, released in August, we see a working-class family move into a catacomb that has been converted into a dwelling. Constrained by money, they take the place of the early Christians, living below ground on the outskirts of more prosperous society. (In Parasite, too, the down-on-their-luck Kim family live in a sub-basement flat.) It’s a reminder that poverty can sink a person in more ways than one.

In May this year, the nature writer Robert MacFarlane’s book Underland was met with acclaim for its profound analysis of spaces deep beneath the Earth’s surface. He uses the term “Anthropocene unburials” to describe events such as the Deepwater Horizon catastrophe and the thawing of the Arctic permafrost. Our activity on the planet has led to what MacFarlane calls “unruly, obscene surfacings”.

So, too, in some of the past year’s best cinema, the social reality we cannot bear to face is re-emerging in unexpected ways. While the capital’s wealthiest residents dig below to accommodate luxury basement conversions, those without a home are forced to shelter in the relative warmth of the London underground. The space below our feet can hold many mysteries, but some are of our own making.