Clockwise, from bottom: Keegan-Michael Key, Tami Sagher, Mike Birbiglia, Kate Micucci, Chris Gethard and Gillian Jacobs in Birbiglia’s “Don’t Think Twice” (Jon Pack/The Film Arcade)

“People are annoyed by improvisers the way they’re annoyed by a cappella groups,” says comedian and filmmaker Mike Birbiglia.

Still, he persevered to write and direct “Don’t Think Twice,” about the tension created in an improv troupe after some of its members audition for a “Saturday Night Live”-like show called “Weekend Live.”

Birbiglia — who stars alongside Gillian Jacobs, Keegan­Michael Key, Kate Micucci, Tami Sagher and Chris Gethard — credits the film’s genesis to a comment made by his wife, Jennifer Stein, a consulting producer on the movie. After an improv performance, she said, as Birbiglia paraphrases, “You guys are all equal onstage, but meanwhile, that person is on SNL, that person is a movie star, and that person shares a one-bedroom with five guys in Bushwick. It’s so unfair.” The troupe in “Don’t Think Twice,” which opens in Washington on Aug. 5, is a group of equals suddenly forced to navigate the hierarchies of fame.

The improv-comedy scene has long been a nursery for SNL. And although this film is the least autobiographical of Birbiglia’s works — which include the acclaimed confessional solo show “Sleepwalk With Me” and subsequent film version — its plot rings true for comedians. It shows what happens when commerce collides with art, and when jealousy has the potential to sabotage friendships.

Gethard (also an author and a co-star on “Broad City”) was a member of the Stepfathers, one of the Upright Citizens Brigade Theatre’s flagship New York teams, when teammate Bobby Moynihan was cast on SNL in 2008. “I probably took it the hardest,” Gethard says. “It really messed with my ego. I did a lot of venting to my shrink.”

At the time, he’d been invited to write for SNL on a trial period but had not been hired afterward. Eventually, Gethard realized, “Bobby’s success was representing this weird thing that made me bitter, but the only person failing was me, because I wasn’t there for a friend going through something stressful.”

Friends can also be shut out by logistics. New cast members are encouraged to keep their hires secret until an official announcement. Chicago-based Dina Facklis recalls when her teammates Aidy Bryant and Cecily Strong were hired by SNL in 2012. “They had to say goodbye without telling us why they were leaving,” Facklis says. “So we didn’t get to celebrate with them.”

Of course, not all friends feel celebratory. Paul Scheer, a UCB improviser and star of FX’s “The League,” recalls that after his first audition for SNL, he went right to UCB, walked backstage and “this person, who didn’t see me come in, was like, ‘I can’t believe out of everybody at UCB, that’s who they picked.’ I remember feeling that so intensely, their weird anger. I still see the person to this day.”

Paul Scheer, center, stars in FX's "The League." Says Scheer of his second SNL audition, “Here were six people, directly competing for one slot, and we respected each other.” (Byron Cohen/FX)

The second time Scheer auditioned for SNL, Lorne Michaels designed an improv team for a one-night-only performance. Improvising with strangers is challenging, though, because the team lacks “group mind,” a term for when players have worked together long enough to predict one another’s moves. “It’s like speaking a secret language,” says Gethard. “When you get to that level of group work, that’s when improv feels transcendent.”

Still, Scheer remembers the ill-advised audition fondly. Before the show, the performers agreed that the first three scenes would each include two people only, ensuring every person an opportunity to shine. “We all agreed not to showboat,” Scheer says. “Here were six people, directly competing for one slot, and we respected each other.”

A similar scene plays out less cordially in “Don’t Think Twice.” When the ensemble learns a “Weekend Live” scout is in the audience, Birbiglia’s character warns Key’s character not to “showboat,” adding, “In industry shows, you turn into a one-man audition tape.” Then, minutes into the set, Key’s character interrupts with a monologue delivered as President Obama. The group seethes behind him.

Showboating at the expense of the scene is an improviser’s cardinal sin. “It undermines trust,” Birbiglia says. “You’re building this thing with each other, and then one of you is like, ‘I’m not going to help.’ ”

Improviser and actor Jean Villepique worked with the Second City from 1998 to 2005, when SNL consistently plucked that theater’s talent. How did seeing Michaels and Tina Fey in the audience affect the performers? “There was so much self-awareness. In extreme cases, it was like, ‘Look at me!’ in unprecedented ways,” Villepique recalls. “If one person starts doing it, the options are either to support it or compete with it. Supporting it feels gross, like there is a status difference in the group. And competing — if a sports team is competing with themselves, how can they play a game?”

Still, most improvisers want careers beyond their teams. “Very few people are going to participate in a showcase to make someone else look good,” Villepique says.

At the Second City, Villepique, who now works and performs in Los Angeles, chose to play with integrity. She recalls her last night there: “One of the [Second City] producers said, ‘You were always a grown-up, thank you.’ That’s when I knew I’d missed something. I was trying to get an ‘A’ in comedy and didn’t realize that there are no grades in the real world.”

“There’s something about falling in love with an art form along with other people that’s borderline perverted,” says Birbiglia, third from right. “You’ve lived out a lot of life together but also acted out a lot of life together onstage.” (Jon Pack/The Film Arcade)

“Don’t Think Twice” explores which relationships can overcome these disparities in success and which can’t. “There’s something about falling in love with an art form along with other people that’s borderline perverted,” says Birbiglia. “You’ve lived out a lot of life together but also acted out a lot of life together onstage.”

And the longer you’re around, the more at peace you become with industry opportunities. When Alison Rich was hired to write on the 2014-2015 season of SNL, she felt mature enough to tackle the process. “Years ago, before I was ready,” she recalls, “there were times when I heard about people getting to [audition], and I’d get insecure and be like, ‘When’s my moment?’ But you grow up and realize you’ll get your chance.”

A year or two after Scheer’s third and final SNL audition — which involved a meeting in Michaels’s office — Rob Riggle, Scheer’s teammate on the long-running UCB house troupe Respecto Montalban, joined the SNL cast for the 2004-2005 season. Scheer was sanguine. “I had a shot,” he says. “I didn’t get it, but I had my shot. So I was psyched for him.” Over the years, Scheer and his teammates learned to value each other over commercial work because, he says, “when you get a job, who even knows how long you’ll keep it?”

Birbiglia reread George Orwell’s “Animal Farm” while researching the script and wrote a phrase on his wall for inspiration: “Art is socialism but life is capitalism.”

“If it’s your last day on Earth,” he imagines, “to perform a beautiful, vulnerable piece of improv theater for 25 people — that really connects with them or makes them feel less alone — that is more powerful than being on a crappy sitcom that people half-watch.” This may be true. But the film also accepts the other reality: Some beautiful, vulnerable improvisers are more equal than others.