In the pantheon of Noah Baumbach sonuvabitches, Roger Greenberg (Ben Stiller) has to be at or near the top. That’s no small achievement, given the competition: Lester Grimm (Eric Stoltz), the hero of Mr. Jealousy, gets so worked up about his girlfriend’s sexual history that he questions her for sleeping with him too quickly; Bernard Berkman (Jeff Daniels), the bitter, womanizing cheapskate in The Squid and the Whale, takes advantage of his academic stature by bedding the creative-writing student his teenage son lusts after; and the judgmental, imperious Margot (Nicole Kidman) of Margot at the Wedding mines the intimate details of her sister’s life for fiction while regarding her awkward son with embarrassment and contempt.

Baumbach’s disinterest in making his characters “likable” has been a hallmark of his work from the beginning—and largely a strength, too, given most movies’ puppyish eagerness to ingratiate themselves with the audience. But the eponymous heel in Greenberg pushes that prickliness to the limit: spending his days handwriting letters of complaint over petty grievances, sabotaging his band’s future over niggling issues with a major-label contract, throwing a tantrum when a friend arranges a “Happy Birthday” dessert at a restaurant. (“Sit on my dick, asshole!” he screams, after blowing out the candle.)

And yet, there’s Greta Gerwig. Baumbach isn’t the type of writer to succumb to a tidy bastard’s-redemption premise, but Gerwig’s presence in Greenberg goes a long way toward redeeming the movie, even if Greenberg himself is a hopeless case. As Florence, an all-purpose “assistant” who helps the hapless Greenberg housesit while his brother’s family is out of the country, Gerwig functions as an opposing force, as open and optimistic about human nature as he is sour and misanthropic. The comic and romantic tension in the film comes from the push-and-pull between their divergent temperaments, not to mention the generation gap that yawns beneath their feet. But for all of Gerwig’s intrinsic brightness, Florence gets caught in the riptide of Greenberg’s boundless narcissism. Watching her wither under his contempt is part of what makes Greenberg such a tough sit for many viewers, including Baumbach’s fans. It’s like “Bambi Meets Godzilla.”

But one lost battle is not the war. Gerwig’s challenge to Baumbach’s negativity gained more leverage in Frances Ha, his deft black-and-white comedy about the misadventures of Gerwig’s urban nomad, and the new Mistress America, which casts Gerwig as an irrepressible autodidact who boasts of teaching herself how to be an autodidact. As Baumbach’s creep into middle age has heightened his Greenbergian instincts—which overwhelmed the disappointing While We’re Young, the only one of his past four films without her in it—Gerwig’s presence as his lead actress and co-screenwriter has given his work a levity and balance it might otherwise lack. She’s a positive force, but also an agent of chaos, to the point where Baumbach is just as likely to pick up odd lines, dance moves, and bits of observation from her as he is to stage conventional dramatic scenes.

Asked about Gerwig’s distinguishing qualities, Baumbach emphasizes her spontaneity. “You want every actor to be as ‘in the moment’ as possible, but Greta has a way of approaching every take as if it’s the first time,” he says over the phone. “And I tend to do a lot of them. Whatever’s particular to that moment and that take will inform how she plays it, in a way that’s so alive and exciting. She’s in control and out of control at the same time.”

Gerwig’s performance made it seem like she had a hand in Greenberg’s conception, though in fact she won the role in an audition and asserted herself later, when she and Baumbach became creative (and personal) partners. Frances Ha was designed as a vehicle for her, tailored around her interest in dance and in young New Yorkers who don’t have their shit together. With Gerwig as co-writer and star, the film feels as much hers as Baumbach’s, propelled forward by an impulsive verve that’s subtly checked by a world that doesn’t always bend to her will. Baumbach has talked about wanting Frances Ha to feel “buoyant,” and the film succeeds so thoroughly that its pervasive sadness can be hard to recognize. Gerwig drifts from address to address, faces constant rejection and discouragement in her career, and loses touch with her best friend, but the film doesn’t succumb to sadness as other Baumbach works might.

“To me, they all feel like very different characters,” said Baumbach of Gerwig’s performances in Greenberg, Frances Ha, and Mistress America. “But I think Greta has an ability to play both comedy and some degree of melancholy and pathos. To varying degrees, these elements live side by side in all my movies and she’s doing both always.”

Another refreshing aspect of Baumbach’s Gerwigification is that both Frances Ha and Mistress America are primarily about the relationship between women (though Baumbach points out that Margot at the Wedding also turns on the frayed bond between sisters). The sudden break between previously inseparable friends casts Gerwig’s character adrift in Frances Ha, but in the new film it’s a sudden closeness that proves perilous. As Brooke, an ambitious but flaky dreamer preparing to launch a high-concept eatery in New York, Gerwig sweeps around the frame like a hurricane, sucking everyone into her orbit. Brooke’s charisma overwhelms her soon-to-be-sister-in-law Tracy (Lola Kirke), a lonely college freshman who’s looking for a friend but gets taken for a ride. As with Frances Ha, men are part of the equation but not central to it—at heart, both films are about unsettled women whose agendas sometimes undermine their loyalty to their friends.

“With Frances, we didn’t realize until after we’d written the script that we told a story about two women that didn’t have a male love interest or significant male part in it,” Baumbach says. “And I think we liked that, retrospectively, and were proud to have done it. With Mistress America, having done that once, we were maybe more motivated to try it again in a different way. Both stories felt like whatever was going on had to be settled between these two women.”

Mistress America continues to play up Gerwig’s gift for physical comedy, and the plot, which whisks Brooke and Tracy to Connecticut in search of startup money, gives the second half a screwball zaniness unmatched in Baumbach’s work since Mr. Jealousy. Brooke’s theatricality comes through in a splashy introduction in Times Square, as she strides down the stairs toward Tracy with her arms outstretched and announces, “Welcome to the Great White Way!” From there, she ropes Tracy along as if her new friend were Cary Grant’s blinkered paleontologist in Bringing Up Baby. Tracy has no choice but to follow.

“Those [screwball] movies are highly verbal, but they’re also very physical,” said Baumbach. “In that way, [Gerwig] reminds me of actresses from that era. Something I did with Frances and continued with Mistress America was giving her space to move around in and really see her move. She’s like Carole Lombard. She has a grace even when she’s playing a stumbling character.”

Though Gerwig’s presence has lightened Baumbach’s touch, it challenges the prickliness of his work without dispelling it. Mistress America pushes much harder against Gerwig’s innate charm than their two previous films together. Brooke speaks in a breathless monologue that can be exhausting, both for the characters around her and for viewers looking for a contrary voice. She demands the tolerance of passive types like Tracy, who are willing to get swept up in her cult of personality. Mistress America puts us firmly in Tracy’s position, seduced by Brooke but dubious of her intentions and her follow-through. In other words, she’s the one playing the sonuvabitch here. The question is: Can Gerwig survive it?

Three films into their collaboration, Baumbach is confident of the answer. He likens Brooke to a hustler, someone with the “bluster and bravado” to rope otherwise rational people into schemes like a restaurant that doubles as an art gallery and hair salon. They’re sure to lose their money, and probably much more. But because Gerwig is playing her, they—and the audience—aren’t going anywhere.