Zelda (Valerie Leonard), left, a professor, and graduate student Rachel (Katie deBuys) are evolutionary biologists whose discussion of competition, love and lust becomes more than academic. “For a long time I’ve been interested in feminism and its generation gap,” says playwright Sarah Treem. (Colin Hovde)

You wouldn’t think that a playwright who has risen to the upper echelon of the TV industry, in which you can write for an audience of millions and make far more money, would still bother with live theater. But Sarah Treem, the co-creator and showrunner of Showtime’s Golden Globe-winning series “The Affair,” still gets excited when one of her plays is staged. This week, for example, her 2011 play “The How and the Why” began its run at Theater J.

“I miss theater if I’m away from it for so long,” Treem says by phone after a long day at her Los Angeles studio. “I miss that hotblooded interaction. Sitting in an editing room and watching pieces of film put together is not the same as sitting in a theater and feeling an audience respond.”

As in most of Treem’s work, “The How and the Why” features female protagonists whose desires and frustrations drive the action. But her women are neither saintly heroes nor innocent victims; they often make bad choices triggered by lust, ambition and/or insecurity and then struggle with the consequences. In this play, the only two characters are female: 56-year-old Zelda (played by Valerie Leonard), a Harvard professor, and 28-year-old Rachel (Katie deBuys), an NYU grad student. Both are evolutionary biologists researching menstruation and menopause.

They have conflicting theories about the how and why of those phenomena, but their intellectual arguments soon become emotional quarrels, spiked by a long-hidden family history that comes to light. It’s not that the science is a mere excuse for the psychological interaction; it’s that the biological factors that distinguish all women become entangled with the difficult choices that these particular women have had to make about work, competition and romance.

“I started with the science,” Treem says. “I had read a book about female fertility, and two theories stuck out to me: the ‘grandmother hypothesis’ and the notion that menstruation flushes out the toxicity of sperm.” She gave the first theory to Zelda, the second to Rachel, and let them battle it out. “The science is easy for them, the emotions are hard. They talk about biology the way you and I talk about the theater, but it’s hard for them to talk about their feelings. If the actors don’t understand that, the play doesn’t work.”

When Zelda was 28, she sacrificed a romantic relationship to pursue the research that made her famous. Rachel, now 28, is contemplating sacrificing her research to preserve her romantic partnership. They argue over these viewpoints as fiercely as they argue over the evolution of the female Homo sapiens.

“For a long time I’ve been interested in feminism and its generation gap,” Treem says. “The women in every generation believe that their mother’s feminism is clogging up progress, that they have to discover inequality for themselves. Every author has an existential question that they’re wrestling with, and this is one of mine. So you find two people with different takes on it, put them in the room and don’t let them leave until they thrash it out.”

Treem, 36, studied playwriting at Yale University, and several of her plays were produced in New York in the ’00s. Her agent forwarded one to HBO, which was looking for a young woman to write the scenes involving Sophie the gymnast for the series “In Treatment.” Treem was hired, and her early efforts so impressed Gabriel Byrne, who starred as the show’s therapist, that he got her a larger role in writing the show.

“They offered me a lot more money than I was making as an SAT tutor, which I did to support my playwriting,” Treem recalls. “The thing about TV is you have to write very quickly, because there’s never enough time. It turned out that I was very good at writing fast. So I got more and more work. I always thought of TV as my day job, and I always promised myself that when TV took over as the most important thing, I would quit and go back to playwriting. Then I got married and had children, and I decided I wouldn’t quit after all.”

Treem’s initial success in TV led to a job on Netflix’s “House of Cards,” which led to the opportunity to create her own show (with Hagai Levi, the man responsible for “In Treatment”) and assume the top job in the business: showrunner.

“ ‘The Affair’ is the first TV show I created from scratch,” she says. “It allowed me to sink or swim in a way I’d never experienced. The decisions with the casting, the writing, costumes, the locations — it all stops with you. It’s the ultimate responsibility. If it doesn’t work, it’s your fault. It’s not like a play, where you say, ‘Here’s the script; go do with it what you want.’ ”

The television work is time-consuming, but Treem hasn’t lost her yen for the stage. She just wrapped up the third season of “The Affair” and doesn’t have to start writing the fourth season until spring. So how does this mother of two plan to spend her time off from the daily grind of TV production? By writing a new play.

“I find playwriting relaxing,” Treem says. “You don’t have that much time when you’re running a TV show to think, because there’s so little time for anything. But if some form of anxiety has been building up, I know the only way I can resolve it is to take some time and write a play about it.”

If you go
The How and the Why

Theater J, 1529 16th St. NW. 202-777-3210. theaterj.org.

Dates: Through March 12.

Prices: $27-$57.