By Eliana Dockterman
March 8, 2019

Warning: This post contains spoilers for Captain Marvel and the Marvel Cinematic Universe.

Captain Marvel is first and foremost an origin story for Brie Larson’s hero. In the film, the part-alien, part-human warrior visits Earth to try to remember a past that she has forgotten as a full-human and fighter pilot.

But the movie also introduces an important subplot that runs throughout the Marvel Comic books and could play a major role in upcoming Marvel movies: The Kree-Skrull wars. It’s an ancient ongoing battle between two alien races, and earth often gets caught in the crosshairs.

At the beginning of the movie, Carol Danvers (at the time, she’s called Vers—her dog tag broke during an accident, leaving half of her last name visible) fights alongside the Kree, who call themselves “noble warrior heroes,” against the Skrulls. But fans of the Marvel Cinematic Universe may have already suspected that the Kree are not as noble as they make themselves out to be when they spotted two villains from the film Guardians of the Galaxy fighting with the Kree forces in the movie’s trailers.

And indeed, Carol eventually discovers the the Kree are the bad guys after all and switches sides. Here’s what you need to know about the Krees, the Skrulls, and their connections to the rest of the Marvel Cinematic Universe.

Chuck Zlotnick—Marvel Studios

Chuck Zlotnick—Marvel Studios. Korath (Djimon Hounsou) and Minn-Erva (Gemma Chan) with Leader of Starforce (Jude Law)

Who are the Kree?

The Kree are an alien race aggressively trying to expand their domain. Some of the Kree are blue-skinned, but others look like humans. Not all the Kree have superpowers, but some do have advanced powers. In general, the Kree are best known for their pugnaciousness and ruthlessness.

They’re imperialistic and try to force other races (like the Skrulls in this movie) to submit to their rule. Carol seems to not understand this when she trains to be part of the elite special teams force led by Jude Law’s Yon-Rogg. But perhaps fans of the Marvel Cinematic Universe became suspicious of the Kree’s motives when they saw Yon-Rogg reported to Ronan the Accuser, the bad guy from the Guardians of the Galaxy. (More on him later.)

As a side note: The Kree are also obsessed with trying to evolve their race. At one point they create a race called the Inhumans, who may be the subject of a future Marvel film.

What is the Supreme Intelligence?

In the movie, Carol has to meet with something called the Supreme Intelligence in order to be cleared to go on a mission. Yon-Rogg tells Carol that the Supreme Intelligence appears to each person as the being that they most admire. When Carol meets with the Supreme Intelligence, she appears as Annette Bening’s Mar-Vell, a scientist that Carol held in high esteem back in her time on earth.

In the comics, the Kree combine the minds of their greatest intellectuals to create the Supreme Intelligence, an organic, artificially intelligent construct. They then submit to the Supreme Intelligence’s dictatorial rule.

Marvel Studios' CAPTAIN MARVEL..Talos (Ben Mendelsohn)..Photo: Chuck Zlotnick..©Marvel Studios 2019
null—null

Who are the Skrulls?

The Skrulls are a shape-shifting alien race that can impersonate any person or alien. In the movie, the Skrull are led by Talos (Ben Mendelsohn). At first, Carol thinks that the Skrulls are bad guys, plotting to subvert the noble work of the Kree. Later, on earth, she finds out that the Skrulls are actually just the victims of the genocidal Kree.

Carol helps Talos reunite with his family on the ship that Mar-Vell built and promises to help them find a new home.

Chuck Zlotnick—Marvel Studios. Captain Marvel (Brie Larson)
Chuck Zlotnick—Marvel Studios

What is the Kree-Skrull War?

The Krees and Skrulls are ancient enemies, and really what more reason do they need to fight? In the comics, their war — which began with an argument over who was the strongest alien race — has spanned hundreds of thousands of years.

The Captain Marvel film adds a new twist: When the Skrulls resist Kree rule, the Krees try to massacre their entire race. Carol essentially helps the Skrulls go into hiding after fighting the Kree herself.

When Mar-Vell, a Kree agent masquerading as a human scientist on earth, finds out about this, she tries to help the Skrulls by building an engine that could help a ship travel at light-speed. She stows several Skrulls away on a ship and plans to use the engine to fly the Skrulls to a distant planet where the Kree can’t find them.

She harnesses the power of the Tesseract—which fans of the Marvel Cinematic Universe will recognize as an Infinity Stone—in order to create the technology. However, the Kree discover Mar-Vell’s plans and kill her before she can complete her mission.

How does Carol Danvers get her powers?

Carol volunteers to fly Mar-Vell to a remote location to destroy the super engine that she created before the Kree can get their hands on it. When Yon-Rogg shoots down their plane, kills Mar-Vell and approaches Carol, Carol shoots the power source created from the Tesseract. The thing explodes, and Carol is imbued with superpowers.

The Krees, recognizing Carol’s supreme abilities, then wipe Carol’s brain and turn her into a super soldier.

Marvels' Guardians of the Galaxy.
Jay Maidment—Everett Collection/Disney. Korath (Djimon Hounsou)

How does this all tie into Guardians of the Galaxy?

Two of the Kree warriors who fight alongside Carol are Ronan (Lee Pace) and Korath (Djimon Hounsou). Fans may remember both characters from Guardians of the Galaxy. In that movie, they are bent on destroying the planet of Xandar, another ancient enemies of the Kree. (The Kree, apparently, have a lot of enemies.) By the time Guardians takes place in 2014, the Kree and Xandarians have signed a peace treaty, and any hostile action that Ronan takes would start another war.

Ronan strikes a deal with Thanos to retrieve a powerful orb for him in exchange for help annihilating Xandar. However, when Ronan realizes that the Orb Thanos wants contains an Infinity Stone, he tries to use the power of the stone himself. The Guardians of the Galaxy stop him and both Ronan and Korath die.

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

Read More From TIME

EDIT POST