Infinity War seriously thinned the number of superheroes who can take on Thanos in the fourth Avengers film. If the superpowered team plans to defeat the Infinity Gauntlet–wielding alien, it will need backup.

Enter Captain Marvel, Marvel’s first female superhero to get a solo film. Her eponymous epic, set in the 1990s, outlines the character’s origin story: Carol Danvers is a fighter pilot with alien powers. She can fly, shoot beams from her hands and pack a major punch. In short, she’s the most powerful superhero in the Marvel Cinematic Universe.

There are seven weeks between the debuts of Captain Marvel and Avengers: Endgame, and her presence in Endgame was presaged in 2018’s Infinity War: Nick Fury sends her an SOS signal on a pager when he realizes that Thanos is destroying half of all life in the universe.

Fans have been begging Marvel for a female superhero film ever since they spotted Scarlett Johansson as Black Widow in Iron Man 2 in 2010. But back then, many studio executives still considered female comic-book movies a risky bet. Flops like Catwoman and Elektra lent to the notion that the teen boys who made up much of the superhero-movie audience simply wouldn’t be interested in watching a woman save the world. In leaked Sony emails from 2014, a Marvel executive called female superhero movies a “disaster.” So for years, onscreen crime fighters remained male, white and straight. Occasionally, sidekick or villain characters broke that mold, but never did they get their own films.

Of course, Catwoman and Elektra were simply terrible movies. As soon as studios began to greenlight good genre movies with female leads, audiences upended the old misogynist view. The Hunger Games proved that female heroes could draw massive audiences. Star Wars: The Force Awakens, starring Daisy Ridley as the first prominent female Jedi, broke box-office records. Mad Max: Fury Road showed that a provocative female character could upstage her male counterpart, even if he’s the one with the decades-old fan following.

In 2016, Marvel announced that Brie Larson, fresh off a Best Actress Oscar win for Room, would portray Captain Marvel in a 2018 film. But the movie was delayed until 2019, and in any case, Warner Bros. beat Marvel Studios to the punch: DC’s Wonder Woman made her big-screen debut in 2017.

The critical and commercial success of that film has taken some pressure off Captain Marvel. Wonder Woman set several records, including highest-grossing live-action film directed by a woman. In theory, the success of Wonder Woman put the tiresome debate about whether a female superhero movie could succeed to rest. But as the trailblazer, Wonder Woman had to tread carefully: her costume could neither be too sexy nor too masculine, her philosophy neither conservative nor pugnacious. Wonder Woman, originally conceived during World War II, is a distinctly feminine hero: She wears heels and a skirt. She falls for Steve Trevor. She preaches love and peace. Her power is awe-inspiring, not frightening. As a result, she had to contend with criticism from feminists that she was too sexy and too passive, while dodging comments from misogynists who didn’t want to see any woman in power onscreen.

Captain Marvel is a completely different character from Wonder Woman, and even before her debut she has faced an entirely new set of criticisms. She’s a control freak with a big ego and a bit of a temper. She’s occasionally reckless and delightfully unconcerned with making anyone around her feel comfortable. And as internet trolls have noted in the comments section of the Captain Marvel trailers, she doesn’t smile.

Telling a woman to smile more is a favorite tactic of misogynists, and a cohort of Twitter provocateurs quickly latched onto Larson’s stoic visage when the teaser premiered. The actress fired back a response on Instagram: “Breaking news: You can be you. That means you can smile or not. You can be strong in the ways you want to be. You can own who you are. If anyone tells you different don’t trust them.”

Even as female moviegoers bask in Wonder Woman’s success, the sexist response of a small but loud minority acts as a sobering reminder that society still places certain strictures on female strength. Captain Marvel’s costume is refreshingly masculine in a movie landscape where so-called female-badasses are often clad in leather or short skirts. She intimidates men and revels in that power. In short, audiences have spent decades watching men’s conceptions of female power: women who are strong but not too strong, intimidating but still sexually appealing, hardened but vulnerable under the surface. Captain Marvel violates a lot of those notions, and it’s about time someone like her saved us all.

The Captain Marvel moniker originally belonged to a man. Carol Danvers was just a side character in his story, an officer in the U.S. Air Force. In the 1970s, Carol got powers and a promotion. She took on the name of Ms. Marvel, a nod to the feminist publication Ms. magazine. She worked as a fighter pilot, a NASA scientist and the editor of a women’s magazine who wore scarves and oversize glasses in unabashed tribute to Ms. co-founder Gloria Steinem.

But in the decades that followed, Carol lost much of her swagger. Her superhero outfit, a bathing suit with thigh-high boots, was clearly designed to be ogled, not admired. Finally, in 2012, writer Kelly Sue DeConnick gave Carol a more modern redesign and the Captain Marvel name. (The previous standard-bearer had been dead for years in the comics.) Artist Jamie McKelvie reimagined the costume and gave her a more practical look inspired by her military past, complete with a short Mohawk-esque hairstyle.

Carol is a good role model, though not a perfect one. Her father believed that sending women to college was a waste of money, so she joined the Air Force and has been driven by a desire to prove herself better, smarter and faster than the boys. As DeConnick has succinctly said, when Captain America falls down, he gets up because it’s the right thing to do; Captain Marvel gets back up because she’s thinking “f— you” to the person who hit her.

Few writers imbue female action heroes with such complexity. The women warriors onscreen are often “badass” in the same sort of cliché way: they drink hard, act like one of the boys and zip around on a motorcycle in spandex—but their heart eventually melts when they fall for the hero. Many action-movie screenwriters still assiduously avoid any trait that might render a woman “unlikable” and populate their movies with bland women. “The test that I always give young writers is, if you can take out your female character and replace her with a sexy lamp and your plot still functions, you’re doing it wrong,” DeConnick told TIME in 2014.

Captain Marvel represents a break from those walking clichés. That’s crucial because girls and boys need more female role models onscreen. Right now, the dearth of female superheroes forces girls to learn to identify with male heroes. Boys are never forced to do the same. The result: men who run studios don’t feel they can relate to women, and thus they don’t make movies about women. It’s a self-perpetuating cycle.

“Everyone wants to identify up, to aspire up,” DeConnick said in the same interview. “So if you are female and therefore lower status in terms of your cultural power, it’s much more comfortable to identify up with a male hero than it is for men to identify down to a lower-status [character].”

Though DeConnick’s comic Captain Marvel No. 1 immediately sold out when it debuted in 2012, millions of non-comic-reading moviegoers are about to meet her for the first time on the big screen. Directors Anna Boden and Ryan Fleck introduce Carol while she’s under the tutelage of an alien warrior (Jude Law) who belongs to the Kree race. At some point, Carol realizes that although she has the powers of a Kree, she is human and had a previous life on Earth that she cannot recall. She visits her home planet to discover her past. While there, she teams up with Samuel L. Jackson’s Nick Fury—at this point the future S.H.I.E.L.D. boss is a lowly government desk jockey—to battle the villainous Skrulls, a shape-shifting alien race that has invaded Earth.

The introduction of the dastardly Skrulls means that Boden and Fleck can include cheeky scenes where Carol punches enemies disguised as adorable old grandmas. But their presence could also completely disrupt the Marvel Cinematic Universe: anyone audiences have previously met could be a Skrull in disguise.

Considering that Captain Marvel takes place in the 1990s, that leaves decades for the Skrulls to get up to hijinks—and three missing decades for Carol to explain to the Avengers. Where was Captain Marvel when Thanos was collecting Infinity Stones? If she’s so powerful, how come none of the Avengers seem to know about her? And how did she prevent herself from aging between the events of Captain Marvel and Endgame?

What’s certain is that the Avengers are counting on Carol to save the day. It took 21 movies for Marvel to put a female superhero at center stage. Now the studio hopes it will take just one film for Captain Marvel to prove herself the most powerful superhero in the universe.

The following feature is excerpted from TIME: The World of Marvel available at retailers and on Amazon.

Write to Eliana Dockterman at eliana.dockterman@time.com.