In an early episode of the Julia Roberts show Homecoming, a soldier is brought back from Afghanistan to live in a rehabilitation centre in Florida, where he will learn to reintegrate into civilian life. At dinner in the hall, he begins to question the food on the plate in front of him. The pineapple cobbler the men are served every night is “really laying it on thick”, he announces, served to make them believe they are in Florida. But how do they know where they really are? Could they leave the facility, from which they are supposedly free to go, to have a beer in a local bar? Are we watching a soldier grapple with PTSD, or are his questions about his reality actually pointing towards the series’ central mystery, tantalisingly about to unravel?

In Homecoming, Roberts stars as Heidi Bergman, a case worker at the facility. When we meet her four years later, she seems not to remember much at all about her work there. There is layer on layer of uncertainty and unreliability, a sense that the floor is shifting underneath us. That suits Sam Esmail, the creator and director of the series, just fine. He created the similarly perception-bending Mr Robot. “I never consciously made the choice when I wrote Mr Robot or signed on to Homecoming,” he says, over the phone from Los Angeles, “but what ties those projects together is something that resonated with me about our relationship with reality, and whether we can trust it, or not.”

Facebook Twitter Pinterest ‘We are being fragmented – and we are voluntarily doing it’ … Julia Roberts and Stephan James in Homecoming. Photograph: Jessica Brooks/Amazon Prime Video

Homecoming is the latest in a recent wave of television shows that turn introspection outwards. In Noah Hawley’s Marvel-based series Legion, Dan Stevens plays Haller, a mutant diagnosed with schizophrenia, who navigates incarceration while dealing with several characters who live inside his imagination. (In the comics, he has dissociative personality disorder, once known as multiple personality disorder.) It’s a head trip overloaded with joyfully outrageous visuals.

In Netflix’s Maniac, directed by Cary Fukunaga, volunteers for a medical trial experience altered realities, mostly induced by the drugs they are taking. Jonah Hill’s character, Owen Milgrim, has schizophrenia, which means that, even outside the trial, he has visions of a version of his brother, guiding him on a mysterious quest. The division between what is real and what is imagined is never quite clear.

While many of these series deal with real psychiatric disorders, these are not documentaries, and they exist within a fantastical world. Esmail is aware of the responsibility that comes with portraying psychiatric disorders on screen. “There’s one side of it, which is to be respectful, but there’s another, which is to have it resonate with people,” he says. “That was really important in Homecoming and Mr Robot. You never want to turn it into something gimmicky because I think that would feel cheap and disingenuous.”

Facebook Twitter Pinterest Head trip … Legion with Dan Stevens. Photograph: Suzanne Tenner/FX Networks

Dr Mark Freestone is a senior lecturer in psychiatry at Queen Mary University of London. He is also a psychiatric consultant on Killing Eve, where he advises on assassin Villanelle’s psychopathy. “I think everybody has some things inside them that aren’t quite right, some odd beliefs about themselves, some strange perceptions,” he says. “Sometimes you might see things or hear things that aren’t there, and I think that’s common to just about everyone. What this spate of TV series is saying is, look, we want to put that on the screen and look at it and see if it makes sense to us, or helps us to better understand our own situation.”

Some would argue that this current vogue for alternate psychological realities began with Mr Robot, although its central character, Elliott, played by Rami Malek, has what appears to be dissociative personality disorder, which leaves the viewers adrift as to who, or what, is actually there. Esmail says that, while he has seen a lot of shows recently that bring a character’s psychological state to the fore, “I don’t know if I would credit Mr Robot with kicking that off. When I first saw The Sopranos, just the concept of a mafia captain seeing a therapist, was groundbreaking and novel and fascinating. Maybe I would put the credit there, where we started to get into psychology in a direct way.”

Only a dream … James Gandolfini in The Sopranos. Photograph: Channel 4

As well as the psychological setting of the therapy sessions between Tony and Dr Melfi, The Sopranos was famous for its dream sequences. Creative writing courses teach pupils to avoid the unfair rug-pull of “it was all a dream”, but The Sopranos turned it into a masterful way to explore the characters’ motives and hidden desires, such as The Test Dream, from season five, which saw Tony riding a horse through the family living room. “You can tell that David Chase and his team really took those episodes seriously,” Esmail says, “because they had the dream episodes down right, in terms of dream logic and how we dream, and why certain imagery and symbolism reappear in dreams and what they mean. It’s one of my favourite episodes of television, and definitely my favourite Sopranos episode, because it dealt with psychology in such a cinematic way.”

Upending the certainty of a situation is a potent dramatic device. Legion and Maniac are, at heart, thrillers, as is Homecoming, though the latter has more of a classic, Hitchcock feel. (Hitchcock himself played with such conventions in Spellbound, his 1945 noir about amnesia with a dream sequence created by Salvador Dalí.) If even the lead character doesn’t know what is going on, then the audience is pulled in deeper, to try to figure it out for themselves. And, as TV becomes more cinematic, there’s a lot of appeal in the ability to paint a more surreal picture, using nightmares and hallucinations. From Mad Men allowing Betty to dream a conversation with her dead parents while giving birth, to Maniac’s grotesque and cartoonish medical facility, these shows are all obscenely good-looking and visually inventive.

“Sam Esmail, Cary Fukunaga and Noah Hawley are three of the most interesting showrunners working in television today. They want the tense and paranoid words on the page to be matched by the imagery,” says Peter White of the entertainment news site Deadline. And the television industry is particularly welcoming to interesting storytelling right now. “Money is driving this experimentation. The golden age of drama, or peak drama, is largely being driven by a relatively small number of well-funded technology companies and pay-TV broadcasters. These companies seem to be more interested in commissioning complex, niche programmes that appeal to specific audiences rather than looking for the next Big Bang Theory or CSI.”

There are broader cultural reasons for this renewed interest in the inner workings of the mind. This is an age of ego, self-examination and narcissism. “When we say narcissism, that’s really brought on by technology,” says Esmail. “Now everyone has a platform. Everyone can be a publisher. Whole lives are put up for people to react to, to like, to dislike, to comment on, and, yes, that has turned everyone to look inwards, and to curate a personality.” He says this creates positives and negatives. “But I do think that that fascination has carried over into storytelling. Great storytelling is always a reflection of the times.”

Facebook Twitter Pinterest Unprecedented paranoia … Carly Chaikin and Rami Malek in Mr Robot. Photograph: USA Network/Getty Images

What characters such as Elliott in Mr Robot or Owen in Maniac are shown to be experiencing is a fractured version of reality. “We are, as people, being fragmented,” Esmail says. “We are voluntarily doing it. Think about the divided personality we have. We have our curated personality online, on Facebook, and we only present certain aspects of our life on there. And then of course we might have a different personality on Instagram, a different personality on Twitter. We’re intentionally fragmenting ourselves.” It’s little wonder that the characters we see on screen are beginning to reflect some of that internal division.

Another thread running through each of these shows is a deep mistrust of authority, whether in the pharmaceutical industry, or the military, or the government, or some mysterious conglomerate of all three, propped up by shadowy business megabucks. Esmail points out that this, too, is tied to technology. “I never imagined I would be alive to see a trillion-dollar company, but now we have two [Apple and Amazon]. It feels really disproportionate and incredibly scary, that they could amass that amount of wealth, and the power they could wield with that.”

We live in an era of mass surveillance, in which our phones and our household appliances are able to listen to or even record our conversations. Then there’s our political climate: misinformation, fake news, dishonest politicians, a culture in which the idea of believing what you see or hear is an increasingly rare luxury. “It all adds up to this unprecedented increase of paranoia in society,” Esmail says. It makes sense we are drawn to characters who are forced to confront that, albeit in extreme ways. “Absolutely. I think that’s a reflection of how we feel.”