In Thursday’s first-season finale of Evil, the psychological/supernatural drama that debuted on CBS last fall, protagonist Kristen Bouchard wakes up from an imagined encounter with a killer only to learn that what looks like her real bedroom is in fact another nightmare. She frees herself from the second dark dream and again lies alone in bed, but a monster torments her, revealing that she’s in a new nightmare. The monster disappears when her daughter shakes her awake, but blood soon starts running in rivulets from the girl’s mouth; it’s yet another nightmare. Finally, she sits up in bed, flanked by four peacefully sleeping daughters. She’s actually awake, or so we assume. In Evil, though, the waking world is just as disquieting and disorienting as the one that sometimes haunts us when we’re asleep.

Evil is the cocreation of Robert and Michelle King, the married writer/producer duo behind seven-season CBS staple The Good Wife and its CBS All Access spinoff, The Good Fight. Although Evil features a few scenes in court, it’s far from a legal procedural. Rather than dwelling on competing interpretations of the law—or, in The Good Fight’s case, competing tactics for resisting a Republican takeover—Evil focuses on competing explanations for bad behavior. The series revolves around the investigative trio of David (Mike Colter), a Catholic priest in training, and his associates Kristen (Katja Herbers), a forensic psychologist, and Ben (Aasif Mandvi), a tech expert. The three probe instances of supposed demonic possession, with the devout-but-not-dogmatic David representing the church in each inquiry and Kristen and Ben supplying scientific or technological reasons why an exorcism is not necessary.

The season is structured as a series of stand-alone cases, although the disturbed or deranged individuals whom David and Kristen interrogate may or may not be part of a pattern orchestrated by their possibly possessed nemesis, Dr. Leland Townsend (Michael Emerson, in oily, menacing mode). The Mulder-Scully dynamic between David and Kristen makes The X-Files a frequent comp for Evil, although in that series, the skeptical Scully was the one who believed in God. But The X-Files was fairly upfront about the existence of paranormal events, whereas Evil studiously avoids coming down on either side of the scientific/demonic divide.

David sees each case as a skirmish in an eons-old battle between God and the devil, whereas Kristen typically comes up with a well-documented syndrome that would also explain the subject’s symptoms. In David’s eyes, evil acts have a larger purpose; the worst enemy out there is not always oneself. It’s a somewhat seductive way of looking at life, one that makes suffering seem less senseless and makes seminarians seem like enlistees in a fight for the fate of humanity. “This is warfare,” one priest tells him, “and we’re fighting the worst enemy on earth.”

As a Catholic kid who quickly gravitated to the Kristen side of the faith/science spectrum, I remember being bored in church and wishing religion resembled the David-esque conception I’d seen in End of Days. It may have been a bad movie, but it did, at least, make religion look like an inspiring, high-stakes struggle. Small wonder, then, that Kristen is sometimes tempted to see things David’s way. But the Kings designed Evil’s story to run along parallel, equally compelling tracks. “One way to tell the story is if the supernatural is really happening, and the other way to tell the story is that there’s a perfectly logical explanation for all the situations you see,” Robert King says.

Evil arose out of an ongoing debate about the nature of evil that the Kings, who met in 1983 and married in 1987, have conducted throughout their relationship. Robert, a practicing Catholic, is the real-life David; Michelle, an agnostic Jew, is the Kristen equivalent. After decades of discussion, neither has significantly swayed the other. “I think we still actually fundamentally believe what we believed when we started,” Michelle says. That disconnect in worldview could drive some couples apart, but the Kings haven’t been bothered by their philosophical dispute. “It’s possible we’re just very superficial,” Michelle jokes.

More likely, they’re accommodating, courteous, and willing to entertain alternative viewpoints, characteristics that their on-screen analogues share. On Evil, David and Kristen are attracted to each other intellectually and perhaps romantically despite their divergent beliefs, in part because the task of assessing alleged miracles and possession serves a similar purpose for both of them. Kristen’s daughter is sick, her husband is often away, and her responsibilities as a parent and professional have estranged her from her former occupation as a mountain climber. David is studying to be a priest partly as a defense mechanism: He’s trying to distance himself from his history of addiction problems and his grief for his late fiancée. Their work for the church is a stimulating, if dangerous, distraction from a soporific routine.

“Don’t punk the audience, and they’ll respect you in reverse.” —Robert King

Although the Kings have been comfortable keeping their debate alive for 30-plus years, TV viewers tend to want answers sooner than that, which means it may be difficult for Evil to keep tiptoeing between testing David’s faith and Kristen’s skepticism. The Kings have been careful to avoid overindulging in what they call “Scooby Dooing,” or presenting what seems to be a supernatural phenomenon but then unveiling a plausible natural cause. “The problem is, if you do that all the time, the audience just gets bored,” Robert says. “We’ve been trying to use metaphor and hallucination as part of the way you can scientifically explain the unusual and mysterious.”

The Kings experimented with unreliable narrative via Diane’s microdosing in The Good Fight, but Evil overflows with dreams, visions, and drug-induced hallucinations, most notably in the 11th episode of the 13-episode season, “Room 320.” As David convalesces after surgery to repair a stab wound, he’s harassed and gaslighted by a murderous nurse who seems to target black patients and collect their wristbands as twisted trophies. Until the end of the episode, when Kristen discovers the trophies in the nurse’s locker, it’s not clear whether the threat is all inside David’s head. Even then, though, there’s uncertainty about whether David’s visions of demonic beings and ritual sacrifices in the hospital were real or products of his pain medication. Outside of the hospital, David dabbles in hallucinogenic drugs, a vestige of his old life that he justifies as an essential aid in perceiving God’s plan. The insights he gleans seem to point toward the truth, but they could be coincidences or the result of his mind making subconscious connections.

In their depictions of dreams and visions, the Kings stuck to one rule: Those imagined events had to help their characters solve some problem or reach some realization. They also sought to ground that abstract action and add clarity for the viewer by explaining the practice of lucid dreaming and the brain’s inability to resolve text within dreams. “We felt if we stuck with the science of that, we wouldn’t be punking the audience constantly, which is the key,” Robert says. “Don’t punk the audience, and they’ll respect you in reverse.”

Evil is cosmetically similar to the Kings’ previous work: The series’ composer, casting director, costume designer, and set director are all veterans of The Good Wife and/or The Good Fight, as are all or most of the cinematographers, editors, and production designers. The cast also includes multiple mainstays of the Kingverse: Colter, series regular Kurt Fuller (who plays Kristen’s therapist), and recurring guest star Renée Elise Goldsberry are Good Wife/Fight veterans, and frequent King collaborator and muse Jonathan Coulton contributes a song that’s central to the season’s story arc.

There’s some thematic and tonal overlap, too. As in The Good Fight, technology in Evil—which builds plots around deepfakes, VR headsets, and smart devices—functions as an entity that alternates between benevolence and malevolence, a pervasive force so advanced and incomprehensible that it’s almost indistinguishable from the supernatural. In the wrong hands, a high-tech tool for determining the truth can become a means of obscuring it.

Evil also exhibits its creators’ capacity for flitting between drama and levity. Although The Good Fight ostensibly deals with despair and the conflict between idealism and pragmatism, it’s also one of the most sophisticated comedies on TV. Evil can be creepy, unsettling, and serious. But like Darin Morgan’s classic X-Files episodes, it’s often funny, absurd, and silly: The real or fictitious demon that plagues Kristen’s dreams is named George, and Kristen’s kids babble in unison whenever they enter a room, rendering them unintelligible. The Kings cast the versatile and entrancing Herbers, whom U.S. audiences may recognize from Westworld, Manhattan, The Leftovers, and The Americans, after seeing some of the comedic roles she played in her native Netherlands. She also studied psychology, which couldn’t have hurt.

Evil does depart from The Good Fight template in that it’s less explicitly political and partisan. The Kings have revisited their debate about evil more often in the current political climate, and their consternation about the Trump regime was one of the reasons they chose to develop the show. While the first season does incorporate a plot line about incels, online forums, and radicalized shooters, though, the Kings ended up delving into politics less than they’d planned. “We had an episode written about David following this map to see that the religious support toward the current administration tended toward evil,” Robert say. “But we thought that would be seen as such a liberal screed that we had to find another gray area as a way to approach it. We need to find something where there’s an argument on both sides, or it just seems like you’re writing a political tract.”

Although the Kings are coproducing Your Honor, an upcoming legal drama on Showtime, BrainDead and Evil are manifestations of their desire to delve into more visually adventurous territory and avoid typecasting as legal procedural writers. Working on Evil pushed them to learn about less familiar topics, with help from a priest and a psychology professor who consulted on the series. That preparation paid off: Evil is their first non–Good Wife/Fight project to get a second season, after 2006 police procedural In Justice and 2016 political satire BrainDead went one and done. They may not be Berlanti-type superproducers, but they’ve broken out of a constrictive, albeit critically acclaimed, box.

The Kings are masters at working within the boundaries of network TV. Although it’s tantalizing to consider what they could create with a blank check from Netflix, the limitations that their network imposes on length, language, and content spurs them to experiment. “Every piece of it fosters creativity except the running time,” Michelle says. “There’s nothing fun about being locked in there.” In all of their shows, the Kings have toyed with TV tropes, via caricatures of stereotypical network dramas (like The Good Wife’s Darkness at Noon), Coulton’s “previously on” songs on BrainDead and explainer songs on The Good Fight, and even the unpredictable timing of the opening credits.

Robert credits NBC’s Hannibal for inspiring some of Evil’s risk-taking. “You swear everywhere in your everyday life, on the street, on the subway, wherever, and no one looks,” he says. “But swearing in church, everybody’s stunned. And so network is a version of that church. Suddenly you have a demon therapist, and on cable you’d just go, ‘Yeah, OK, it’s Tuesday,’ but you do it on network and it’s like, ‘Holy shit, they’re doing this on network?’ It just kind of adds another level of disbelief about it, which is healthy.” In one scene in Evil, a gunman accidentally shoots himself while striking a pose straight out of Taxi Driver, a touch of dark comedy that forced the visual effects supervisor to stretch to ensure compliance with Standards and Practices. “It was supposed to be shocking and not what you expect on network, and so that allows you some level of surprise,” Robert says.

“God draws in straight lines,” a priest tells David in an early episode. “The devil draws in puzzles and anagrams.” In that respect, the Kings are closer to the devil. Unbeknownst to CBS, the cocreators inserted clues throughout the season, embedding bread crumbs in episode titles and puzzle pieces displayed in single frames from each episode. Those pieces form a road map, Robert says, to an “additional puzzle that’s meta, outside the show’s structure, and that combined with the titles bring you to some conclusions.” Reddit sleuths are on the case, but the Kings are keeping quiet. “I won’t say anything further, because I’m worried about giving it away,” Robert says. Providing easy answers is the one line that the Kings can’t bring themselves to cross.