“Divorce” stays mired in the angry muck. Horgan told me, “We don’t wring too much misery out of custody issues in this first season.” In other words, battles over children will be something for audiences to look forward to in Season Two. The playwright and actor Tracy Letts, who appears in “Divorce,” says that, when he first read the script, he said to himself, “This could read like mean-spirited satire.” It avoided that trap, he added, because “you can’t help but feel for the characters.” Horgan, he said, is “good at making real people.”

Sarah Jessica Parker’s production company has a first-look deal with HBO, and for years she had been looking to develop a series about a troubled relationship, at one point thinking that it might be a drama. In 2014, HBO set Parker up on a work date with Horgan, and that night Horgan had an idea for a comedy about a “long-term divorce.” She wrote a treatment pitching a series that would focus not only on a couple but also on the divorce industry: all the lawyers, accountants, and therapists. She included a link to the trailer for “The War of the Roses,” the 1989 Michael Douglas and Kathleen Turner film about a couple whose divorce gets so vicious that one pretends to have turned the family dog into pâté.

Parker told me that she was drawn to Horgan because of her “affection for the dark, sad, and ridiculous that reveals itself in painful circumstances.” Americans use the adjective “dark” to describe a certain kind of comedy, where Brits prefer the word “grim.” Horgan believes that “funny and grim” describes all her work. She told me that she was captivated by the idea that, during a divorce, “two people could feel passionately about someone they hadn’t felt anything for in years.” She was inspired, in part, by the divorce of a friend who left her husband for a man with whom she was having an affair; upon learning of the separation, the lover broke up with her. “We laughed about her backup plan failing—after she scraped herself off the ground,” Horgan says. “There was something comedically tragic about her situation. It wasn’t just tragic. It was a horrible situation that I felt I could use.” She recently apologized to her friend for transforming her story into a show.

In writing “Catastrophe,” Horgan was struck by an interview with Gwyneth Paltrow in which she quoted her father’s explanation for his long marriage: “We never wanted to get divorced at the same time.” The original pilot script for “Catastrophe” began with Sharon and Rob’s first encounter and ended three years later, in the thick of a marriage with children. “The interesting thing was putting the characters, slap bang, in the middle of a relationship,” Horgan says. “How do you stay in love?”

But Channel 4 executives smartly suggested that she and Delaney slow it down, allowing the audience to become as invested in the relationship as the couple is. It is the second season that turns to marriage, beginning with a scene that was in the original pilot: Rob and a pregnant Sharon, in bed, her finger hovering around an orifice as their toddler walks into the room. In the new season, Sharon has postpartum depression. Rob has an office flirtation. They are exhausted. Children have complicated their sex life—though there is still enough sex that Horgan, upon watching the completed episodes, worried that she was “showing it rosy.” A romantic getaway to Paris is almost foiled by a forgotten breast pump. One morning, they awake at a leisurely 7:15 a.m., and Rob congratulates Sharon on their third anniversary. “I’m more proud of us than I am of the kids,” he says. “What’s to be proud of there? Who doesn’t want to take care of their kids?” But, he adds, “maintaining this”—he points at the two of them—“this is the slog.” Sharon laughs and says, “Thanks, lover.”

Horgan hasn’t contended with toddlers for a while. One day during the “Divorce” shoot, her husband, Jeremy Rainbird, visited the office with their daughters: twelve-year-old Sadhbh (pronounced “Sive”) and seven-year-old Amer. Rainbird, like Rob on “Catastrophe,” was in advertising for two decades, until, like Robert on “Divorce,” he quit to get into real estate, which, also like Robert, turned his wife into the breadwinner. He arrived just in time to see Sharon editing a moment that was based on their marriage. “Divorce” is full of these moments: in one such scene, Frances admits to Robert that she wanted to injure him savagely after he threw her laptop out the window. Horgan says that “Divorce” contains “huge parallels to our relationship, taken down different routes.” Rainbird is accustomed to seeing parts of his marital life appear onscreen, but when Horgan showed him the first episode it shook him. “There is so much in it that is recognizable—apart from the divorce bit,” she told me. “It drained the color from his face.”

Horgan has always been her own muse (though she considers the word “muse” to be “wanky”). From a young age, she dreamed of being an actress, and invented little plays, but instead of concocting plot-heavy tales, like many imaginative children, she focussed on her feelings. “A big memory for me is delivering ridiculous speeches—overwrought nonsense—just telling someone how I felt,” she recalls.

Horgan was born in the London borough of Hackney in 1970, decades before the gentrification that has made it one of the city’s hippest areas. (She now lives there with her family.) Horgan’s mother is Irish, and her father a New Zealander, and they ran a local pub. But, around the time a man asked Horgan’s father to supply him with an alibi for a murder charge, they decided that Hackney was no place to raise children. The family moved to Ireland when Horgan was four, eventually taking over a turkey farm in County Meath, outside Dublin. (She is a capable plucker.)

After finishing secondary school, and completing a year of college in Dublin, Horgan applied to various drama programs and was rejected. She went to London and struggled to find acting roles. She worked at an employment-services center for six years, but at the age of twenty-seven, soon after being asked to clean up a pile of excrement outside the office, she quit and returned to college, having concluded that her acting dreams were not going to come true.

One evening in the mid-nineties, Horgan went to a bar in Camden, in north London, and ran into a man she knew named Dennis Kelly. He told her that he had written a play. At the time, Kelly was working at a gallery that sold pictures of elves and pixies, and Horgan was working at a head shop. She asked to read his script, liked it, and helped him cobble together the money to stage it. They began collaborating on sketches, and eventually they sold some to BBC Three’s “Monkey Dust,” a twisted, satirical animated show that provocatively covered everything from immigration to bestiality. One of its creators, the late Harry Thompson, liked their point of view and suggested to them an idea for a sitcom that was simply a title, “Pulling”—British slang for picking someone up. Around this time, Horgan had her first child. “It was the making of me,” she said. “It gave me a different work ethic. It’s such an obvious thing to say, but, if you have to have time away from the baby, you want to be using that time in the best and most productive way.”

“Pulling” began airing when Horgan was thirty-six. It was a deliciously sour poem to the period in her twenties when she and two female roommates shared a Camden flat with missing floorboards and a bathtub surrounded by trash. “I lived with a nurse who ended up in the Hare Krishnas and a teacher who was the biggest party girl of all time, with a psychotic ex-boyfriend,” Horgan recalls. “I was sitting slap-bang in the middle of a sitcom.” Donna, an office worker played by Horgan, breaks up with her loser fiancé. Another character, Karen, is an alcoholic kindergarten teacher with a wild, on-and-off-again boyfriend. Many of Karen’s antics were based on Horgan and Kelly’s own adventures in “hefty drinking.” Like Karen, Horgan once ate takeout food that had been left inside a phone booth. A moment when Karen looks down and says, “Whose fucking knickers are these?” was taken from a long night that Horgan spent at an after-party for the boy band Take That. Kelly, summarizing this stage in their lives, said, “If you went to a party and there was one person in that room you must not sleep with, you ended up with that person the next day.”