Avengers: Endgame made over a billion dollars worldwide in its first weekend, shattering just about every record the Hollywood publicity machine bothers to keep. It is especially remarkable to see the new film doing so much better than its immediate predecessor, Avengers: Infinity War.

That’s because Endgame is more than just Part 2 of a single story, but the culmination of a 22-film series (plus a few short films and loosely-connected TV shows) that racked up almost $20 billion in combined ticket sales. The Marvel Cinematic Universe (MCU) blurred the lines between Prestige TV, blockbuster movie franchises, and the type of serialized fiction found in comic books. A new age of mega-storytelling is well under way. Endgame is gigantic because people who enjoyed any of the previous movies will probably want to check in and see how the whole thing concludes.

They won’t be disappointed, because directors Anthony and Joe Russo made satisfaction their primary goal with Endgame. Some characters reach a definitive end, while others will continue with a sense that a major part of their lives has concluded. Just about every dangling thread from the preceding 21 movies is teased out and knotted off. The movie is a veritable ice cream truck filled with fan service, careful to drop an awesome moment or hilarious line for even the characters relegated to extended cameos.

Endgame focuses on the superheroes who originally came together as the Avengers, who were coincidentally spared from instant destruction in the infamous “Thanos snap” that wiped out half the population of the universe at the end of Infinity War. (There have got to be some really confused folks out there in the far reaches of space who will never understand what the hell happened during the time period covered by Infinity War and Endgame.)

The Russos were wise to take that approach and give audiences a sense of closure with those characters, of reaching the fairly clear end of a reasonably coherent epic tale, while also politely setting the table for the next epic. Of course the MCU won’t stop here, but if it did, Endgame would feel like a satisfying conclusion.

That’s a neat trick, and one that no other aspiring mega-story has truly been able to pull off. Comic books themselves are often chided for the rambling endlessness of their tales, with dead characters constantly returning to life and Never-Ending Battles meandering along for generations of real time.

Frank Miller’s landmark series The Dark Knight Returns stunned the comics world and reached for the status of actual literature by giving the Batman saga a bittersweet conclusion. Batman became mythic because Miller added the literary ingredients that are usually missing from comic books, the ingredients that can only be added if the story ends. (And then Miller went and undermined that ending by writing sequels to the book, while the regular Batman comics have only briefly flirted with the idea that TDKR was the “real” conclusion of saga instead of a little alt-universe possible-future-history daydreaming.)

Broadly speaking, Marvel “soft-reboots” its comics universe from time to time, leaving poor Peter Parker stuck in grad school for decades, while their Distinguished Competition over at DC trots out a maniac with godlike power to blow up their universe every few years, giving every generation of readers a new version of the story about how a rocket ship from Krypton landed on the Kent family farm and a little boy named Bruce Wayne watched his parents die in a back alley.

The Marvel Cinematic Universe did neither of those things. It started in 2008 with Iron Man, told three “phases” or chapters of a single grand story, and concluded the first volume of its story with Endgame in 2019. That’s not how superheroes usually work. It makes the story feel far more weighty and resonant, and certainly a lot less confusing, than comic books usually do.

A tip of the hat is due to Warner Brothers animation team, who accomplished much the same feat with a superb series of television cartoons in the 1990s and early 2000s, beginning with Batman: The Animated Series, culminating in Justice League Unlimited, and ending chronologically with Batman Beyond, which is set decades in the future. The writers of those animated series did a brilliant job of distilling convoluted comic-book plotlines into short, cogent episodes of television, and they gracefully maintained an incredible sense of continuity across hundreds of accumulated episodes and a decade of real time.

It doesn’t seem quite right to label a set of interconnected films and TV shows a “franchise,” a description better applied to something like the James Bond films, which have been largely episodic in nature.

Once in a while the latest Bond film would begin with a tip of the hat to the previous film, but not until the current round of Daniel Craig outings has the series really tried to tell a single epic story, with a convincing sense that the guy you’re watching at the baccarat table is the same person you saw sipping a vodka martini four movies ago, and he remembers all the crazy stuff that happened to him since then.

Next year’s as-yet-untitled Bond film will be the 25th in the series. You can’t make them all fit together into a mega-story the way Marvel’s 22 films concluded with Endgame, not even if you postulate different spies have assumed the name “James Bond” over the years, a fan theory the Craig films explicitly rejected.

The first major stab at mega-storytelling was the Star Trek series, which covered a number of TV series and films that tried to fit together as a unified chronicle of future history – at least they did until the 2009 Star Trek movie created an alternate timeline where none of the other stuff has happened yet and most of it will now happen differently. It makes for a branching mega-story that would be increasingly difficult to explain in full to new audience members, whereas anyone could watch a few key Marvel films and understand the story told in Infinity War and Endgame.

Star Trek is notable because the original series occasionally slipped the bounds of episodic storytelling and called back to earlier events. In the Sixties, it was considered unwise to make a regular television show evolve across episodes because new viewers would feel lost and consider the show inaccessible. (They certainly couldn’t punch up previous episodes on demand to get up to speed, the way viewers generally can today.) It was thought best if the title sequence of the show told new viewers most of what they needed to know to enjoy any given episode.

After Star Trek achieved cult status and returned in theaters, it became free to dabble in long-form storytelling. The best of the Trek films brought back the villain from a single episode of the 20-year-old TV series, played by the same actor (and then kinda forgot who actually met him the first time around.) The next two films told a single interconnected story, then there was a weird interlude about God needing a spaceship, and then a final Old Trek film that felt a lot like Avengers: Endgame does, an elegiac finale for the entire saga.

The Marvel Cinematic Universe made it through 22 films without falling prey to the prequel temptation, a common affliction of mega-storytelling. The other great science fiction series, Star Wars, has a terminal case of it, coughing up prequels left and right, film and TV, live-action and animated.

No lessons appear to have been learned from the (relatively) catastrophic box-office performance of the last prequel, because an expensive television show that is yet another prequel is now in production. At least this one is a prequel to the sequels, rather than a prequel to the originals, although we may yet get a prequel to the prequels. There is something about these grand multi-film, TV-series-spanning sagas that tempts creators to scribble in the margins and flesh out backstories that were much more enjoyable as vague hints and tantalizing phrases like “The Clone Wars” instead of moving the story forward.

The MCU set a few movies in the past, but they didn’t really feel like prequels. Avengers: Endgame takes outspoken pride in the generally smooth continuity of the preceding 21 films, right down to the precise year each one took place in. We even get to hear a few pointed thoughts from a character who knows she’s parked in the middle of a much larger story and sternly lectures a certain member of the Avengers not to screw the rest of it up. The Russos were giddy with the strength of the foundation the previous movies established for them, cheerfully skating in Mobius loops atop very thick storytelling ice.

The integrity of the storytelling across such a huge collected running time is astounding. Avengers: Endgame isn’t just a three-hour movie that people around the world were willing to shell out $1.2 billion to see. It’s the last three hours of a remarkably tight saga that clocks in at almost 50 hours altogether, not counting the peripheral TV shows.

It’s an incredible achievement, one that many other creative teams are trying to copy. The lesson they should learn – a lesson Marvel learned with a few stumbles along the way – is that gracefully telling a grand story is much better than “building a franchise.” That means you need an endgame, the courage to reach it, and the discipline to let it stand instead of unraveling it with cash grab retcons and prequels.