Super science spoilers abound!
Warning: As you might have guessed, this article is overflowing with spoilers for Avengers: Endgame. If you haven't seen the movie, you're probably going to want to stop reading before it's too late. How about reading our spoiler-free review instead?
So the theories were right: Avengers: Endgame is a time travel story, in which the superheroes have to work to undo Thanos's devastating Snap by revisiting several events from their pasts. Specifically, the Avengers go back looking for the Infinity Stones from times before Thanos collected them all, so they can use them in the present to bring back the half of all life in the universe that Thanos managed to eliminate.
With time travel essential to the central plot of the movie, Endgame's characters spend a lot of time explaining what the deal is. They make a point to note that they're not going back to prevent Thanos from accomplishing the snap--they're going to gather the Stones and use them to undo it in the present. The movie establishes rules of time travel to keep the logic straight.
Unfortunately, Endgame is rather bad about sticking to its own parameters, and in the end, its time travel doesn't really make sense. For all the effort spent on running down what you can and can't do in the past, Endgame abandons any effort to stay in the lines whenever it becomes inconvenient. As a result, the plot--while a lot of fun--doesn't make much sense if you apply any scrutiny. Of course, that's what we're about to do.
Now, as a side note: Saying that Endgame's time travel (and by extension, a lot of its plot) doesn't make logical sense is not saying that you can't enjoy it. But the movie sets some rules to navigate a notoriously confusing idea, so clearly it cares about them--and we're here to break down how they're handled. Caution: Get ready for full-on Avengers: Endgame spoilers from here on out.
"Back To The Future Is Bull****"
First, let's look at how Endgame explains its time travel. In a fun scene, Banner lays down the essentials of venturing to and potentially altering the past, noting that most of the movies made about time travel are more Hollywood than theoretical physics. Banner is the one who notes that the Avengers can't go back in time and prevent Thanos from doing the snap by stealing the stones from him--the past is the past and cannot be changed.
Banner says, "Think about it: If you travel to the past, that past becomes your future, and your former present becomes the past! Which can’t now be changed by your new future!" Not exactly helpful, really.
Though he does a really bad job of explaining it, what we're actually seeing in practice in Endgame is a version of multiverse theory. You can't change the past to affect your present, because once you're in the past, your former present is no longer accessible to you. It exists separately from the timeline you've just created by entering the past and changing it. The very act of time travel creates a split in the timeline, because the time traveler interacting with the timeline changes how events play out. Everything from the time traveler's arrival is different by virtue of their arrival.
So if time travel splits the timeline, how do the Avengers get back to their original present? Shouldn't their presence in the past place them in a new timeline branch, with history playing out differently thanks to their influence? Answering this is where the Quantum Realm comes in, along with the idea of a multiverse, or multiple universes. As Banner puts it, you can't alter your past through time travel--it happened and it's set, and it's the series of events that led you to time travel in the first place. Time travel doesn't overwrite your original timeline, as Banner assures us; it creates a new timeline (or, as in multiverse theory, a whole new universe), separate and distinct from the original.
The Quantum Realm connects these distinct universes together, which we see when the Avengers travel through it. That's how they can travel both through time and through space at the same time; just as they're moving through the Quantum Realm, they're leaving it at distinct exits that are in both the place they want to be, and the time they want to be. Meanwhile, the Quantum Tunnel machine that Banner creates gives them an exit point back in their original present in Avengers HQ, so they can always find their way back to their original universe.
So that's how it works: The Avengers go into the past, creating alternate universes (or "branch realities," as the Ancient One puts it), where they can grab the Infinity Stones. This means that changes to the past won't mess up the Avengers' present--essentially, as soon as they arrive, it's not their past anymore.
Good thing, because they mess up a lot of stuff.
All Kinds Of Altered Timelines
When the Avengers head back in time, their goal is to snag the various Infinity Stones from key moments without being detected. They also observe Back to the Future II rules: They try not to interact with their past selves. But as we see throughout the time heist, the Avengers' presence in their own past is fundamentally changing things. Since they're in alternate universes, or branch realities, that doesn't actually matter (for now).
We see a bunch of alterations to the timeline as we know it during the time heist, but since the Avengers return to their own, unaltered present, it reaffirms that what we're seeing are new, alternate universes. And they have some new and pretty big differences to the original, as we see throughout Endgame.
One big change, obviously, is Loki. When Ant-Man and Tony Stark attempt to get the Tesseract (which houses the Space Stone) away from the past version of the heroes in the aftermath of the Battle of New York in 2012, they mess it up. The Tesseract falls out of the case in which Past Tony was transporting it. Loki, the villain of The Avengers who the heroes have just defeated and taken prisoner, grabs the cube, uses it to open a portal in space, and disappears.
At this point, this alternate universe is going to be completely different from the one the Avengers started in. In the original version of events, Loki was captured, taken to Asgard, and imprisoned there until the events of Thor: The Dark World. The Tesseract was locked in Asgard's vault, where it waited until the events of Thor: Ragnarok. Now Loki is out in the universe with the Tesseract--essentially a weapon of mass destruction--after having just failed his megalomaniacal mission of taking over and ruling Earth. Whatever he does out in the universe is going to have serious consequences in that timeline. But Loki in the original timeline is still dead; this is a different Loki, in a different universe, presumably wreaking new and different havoc.
We see a number of other differences the Avengers create in their new alternate universes. Captain America's "Hail HYDRA" may well change a bunch of later events in that universe, as will his fight with the past version of himself, who he distracts with the revelation, "Bucky is alive." War Machine punches out Star-Lord on Morag, which would alter that universe's version of Guardians of the Galaxy, since Korath the Accuser is about to show up to try to nab the Power Stone from Star-Lord. Tony's interaction with Howard Stark in 1970 could change how that universe's version of Tony grows up, which might fundamentally alter his path to becoming Iron Man.
Then there's the question of Past Gamora, Past Nebula, and Past Thanos and his forces following the Avengers back to their original present. Since we've established those folks are from an alternate universe--the one in which Nebula and War Machine went to Morag to get the Power Stone--their presence in the Avengers' present doesn't alter the events of Avengers: Infinity War or anything else. Thanos still gathered the Infinity Stones, killed Vision, and did his snap; Gamora was still killed for the Soul Stone; Nebula still joined the Avengers. What we're seeing are other versions of them from a different universe. The alternate universe Gamora and Nebula are from before the events of Guardians of the Galaxy, which means they don't know any of the Guardians (hence Gamora kneeing Peter in the nuts). When Tony wipes out Thanos with his snap, it's an alternate universe's Thanos, not the one that Thor beheaded. So that other universe is probably in a lot better shape now.
But if the Avengers are just getting Infinity Stones from alternate universes, why do they need to return them? The Ancient One has the answer to that question.
The Infinity Stones And The Flow Of Time
The Avengers make a big deal about discussing how they'll take the Infinity Stones from the past, use them in the present, and then return them to their spots in the past. Because of Banner's explanation, we know that removing the stones from their moments in time won't alter the Avengers' present; they can't go back in time and prevent Thanos. There's no possibility of removing the Infinity Stones from alternate realities messing up the Avengers' universe.
But as the Ancient One points out, taking the Infinity Stones from the alternate universes in which they belong could seriously mess up those timelines.
"The Infinity Stones create what you experience as the flow of time," she explains. "Remove one of the stones and that flow splits. Now this may benefit your reality, but my new one, not so much. In this new branch reality, without our chief weapon against the forces of darkness, our world would be overrun, and millions would suffer."
Basically, the Ancient One is describing the alternate universes we've been talking about all along: Travel back and remove a Stone, and you're creating a new universe that is missing a Stone. And we know from the events of Doctor Strange that without the Time Stone, the Ancient One's universe would be overrun by Dormmamu, who Strange defeated by using the stone.
The Avengers aren't looking to save their universe from Thanos's snap by wrecking a bunch of other universes by removing their Infinity Stones, which is why Banner explains they're going to return those Stones to the moments they were taken. That would "erase" the alternate universes in which the Stones are missing--in the timelines of those universes, since they're returned at the moment they were taken, they effectively never left. For the Ancient One, even though Banner takes the Time Stone with him, he'll bring it back to the second he left, and the Time Stone will be there for Doctor Strange to use against Dormmamu later.
As for what the Ancient Ones means when she says the stones create "the flow of time," uh...who knows. It doesn't seem strictly necessary to understand what kind of space magic she's talking about. What is worth acknowledging is that, according to this movie's surprisingly lax rules of time travel, while all time travel creates alternate universes, only the ones created by removing Infinity Stones are so messed up that they require fixing (or erasing, as Banner puts it).
Captain America's Ending Breaks All The Rules
Endgame ends with Captain America heading back through time to drop off the Infinity Stones in their various locations (which seems like a job for more than one guy, and especially not one guy who's never been to Asgard or Morag, but whatever). When Banner goes to bring Cap back to the Avengers' universe, though, he doesn't show up. Instead, Sam and Bucky find an old man version of Cap sitting on a nearby bench.
The idea here is that, rather than come back with the time machine, Cap just decided to hang out in the past and live the several decades he'd originally missed while frozen in ice after the events of Captain America: The First Avenger. The movie also implies that Cap went back to the past and married Peggy Carter.
Of course, this doesn't track with the rest of the movie's conception of time travel: Steve should have been living in a new, alternate universe created by his presence and influence on the past. Just waiting for years for his time to catch up to the Avengers' wouldn't allow him to meet Bucky and Sam as an old man--under the rest of the movie's rules, he should need Banner's time machine to return to his original universe.
There are a bunch of ways Cap's presence in the past should alter things so that he can't return to his original universe's present. We know from past movies like The Winter Soldier that Peggy had a whole non-Cap life, marrying and having a family, serving as a founder of SHIELD and a secret agent. We can't help but assume Steve showing up and marrying her would have fundamentally altered all of that--which would mean the present that Steve left in the time machine wouldn't be the same as the one he wound up in as he aged. (There are a lot of other issues with Steve's ending as well.) There simply is no way to slice it that makes sense.
All of this is to say that while Endgame is relatively consistent with its use of time travel (even though it is confusingly explained, sometimes in contradictory terms), it doesn't actually always adhere to the guidelines it sets down. In the case of Captain America, the time travel logic doesn't follow. But at least the reason that the Avengers can undo the snap while all the other character deaths remain constant makes sense.
And it seems some of the time travel-slash-alternate universe confusion Endgame creates may be fodder for other stories, like the Loki-focused show confirmed for the Disney+ streaming service. Loki escaping with the Space Stone might be the entire basis for that upcoming show, and we just don't know it yet.
Endgame's time travel might be tough to follow, but its various jaunts into the past do a good job of creating fun situations. Endgame is still a pretty good time--just don't think too hard about it.
If you can't get enough Avengers: Endgame, we've got lots more coverage. Check out our full review of the movie; we've got rundowns of all the Easter eggs hidden throughout its three hours, and a list of every MCU character that appears in the film. You can also get an explanation of the movie's ending, Doctor Strange's plan, and what happened with Loki and the Tesseract. and read our opinions on why Captain America's final moments don't match his character and how Endgame fails Black Widow and most of the other characters.