Despite how easy Marvel Studios makes it look with the MCU, weaving together one cohesive storyline across a movie franchise isn't easy. No matter whether it's comprised of three movies or 22, a series' trajectory is always bound to change. New directors and writers might come in and decide they don't like the tools they've been left to work with, or bankable characters and plot threads producers thought would be instant hits might not resonate with fans - nothing is ever set in stone.
Retcons are an easy way to change the course of a franchise's trajectory though, allowing filmmakers to wave away prior developments in favour of new ideas that completely reshape previous movies. Admittedly, this approach to filmmaking can make franchises feel a little slapdash, and sometimes it even retroactively ruins parts of the prior movies, seen in the boneheaded decision to make Sandman Uncle Ben's real killer in Spider-Man 3.
Once in a blue moon, however, the filmmakers will come up with a retcon that actually solves a problem that could have tanked a franchise if not addressed, even if it's as brash as pretending as entire films didn't happen.