Warning: Massive spoilers for Avengers: Endgame ahead!
The crux of Avengers: Endgame is how the surviving heroes attempt to undo Thanos's catastrophic snap from Infinity War. In order to reverse Thanos's work, the team turns, as many fans have long suspected, to time travel. Without the assistance of the Time Stone, the heroes instead have to develop their own time-travel tech to nab the Infinity Stones before Thanos does, so that they can use the Stones themselves to un-snap everyone. The time travel in the movie, though, is a little bit murky on the rules.
Time travel in Endgame seems to work a little differently than the variations we've become used to seeing in other sci-fi stories. (The characters even acknowledge this in a funny exchange that name-checks other movies like Back to the Future and Hot Tub Time Machine.) Essentially, going back in time and altering something doesn't necessarily create a ripple effect into the future of the timeline we know but instead creates a new timeline, splintering off from the original at the point of change. When the Hulk goes back to 2012 to try to get the Time Stone from the Ancient One, she explains this to him, complete with visuals of a literal line branching off from a "main" line.
This is why, for instance, the deaths of the time-travelling 2014 versions of Thanos and Nebula during the final battle don't somehow negate their present-day selves and actions. If Marvel time travel worked the way we expected, then none of the movies after 2014 could have happened, with Thanos having been killed by travelling to the future and being taken out of the timeline. Instead, though, a new timeline was created, without damageing the original one or the people in it. The same goes for other elements of the "time heist" that significantly deviate from past continuity, such as 2012 Loki escaping with the Tesseract.
This theory of time travel also helps clarify the film's ending, specifically how it deals with Steve and Peggy's reunion. Theoretically, Steve returning to the 1940s to live out his life with Peggy would have made the entire MCU continuity impossible: since Steve's death was the trigger point for the entire universe to unfold, him reappearing would have altered history significantly (not to mention seemingly negating the entire Agent Carter TV series continuity). If we think of it as an alternate timeline, though, it makes more sense that he simply created a new, parallel timeline and then bounced back to his timeline of origin in the film's final moments to hand over the shield to Sam. By relying on splinter timelines rather than a ripple-effect past, Endgame bypasses some of the usual time-travel tangles to focus more on the story at hand.