Marvel has made a bunch of really great, cohesive, films that fit together well. You’d think that they had it all planned it out, and that’s not the case. Rather, the studio looks back at its previous body of work for material that could turn into solutions.
C. Robert Cargill, screenwriter on the 2016 Doctor Strange, says in MCU: The Reign of Marvel Studios:
The biggest misunderstanding of how Marvel works is that everybody assumes that afterthought is forethought. There are lots of things that get added late in the process, but when you do it right, it feels like it was there all along. And movies are reacting to movies—when I wrote the scene with the Ancient One and talked about her looking forward into the future and seeing probabilities, there was no talk about ‘Hey, we’re going to use this in Infinity War.’ But having watched Doctor Strange, they could say, ‘You know what would be cool and fix this problem we have? If we use this power that the Ancient One expresses in Doctor Strange and show that Doctor Strange has that ability from the Time Stone.’ It’s not a master plan—the master document is the body of work, and Kevin. It’s a bunch of geniuses building a story up rather than building towards a story.” While Marvel Studios had constantly refined its process for producing visual effects in the name of reliability and consistency, it took a free-wheeling, almost ad hoc approach to the story those visuals would bring to life.
Another great example is the unplanned use of the time machine in Avengers: Endgame.
There is no perfect plan, no setting and forgetting. Executing anything well requires adapting and improvising to new challenges, as well as assessing new opportunities and resources.
When someone executes well, it looks like they knew what they were doing all along. Sometimes, they’ll even go along with this story or start to believe it. The truth is generally somewhere between improvising to afterthoughts and being uncompromising with forethoughts.