All of us have been there. We finish a movie, book, TV show, or any other piece of media, and the end just leaves us scratching our heads. Why did the characters decide to do that? Why exactly did a certain event happen? Why did things turn out that way? Sure, there are endings that are incredibly satisfying and wrap everything up nicely in a way that makes us not feel cheated, but then there are those that make us ask ourselves why.
I adore these endings, but only when they work. And to work, I believe they must fit the entire story that precedes them. For example, take the 1982 John Carpenter film The Thing, one of my favorite movies of all time. While the premise of an alien that takes control of the various scientists at an Antarctic base, making it a sort of slasher movie mixed with some mystery elements. The exposition is light, giving no explanation to what the scientists are studying, where the alien came from, or even what exactly happened at the base in the beginning of the movie (The prequel does tell this story, but that's precisely why I hate it, among other reasons).
The only reason The Thing doesn't tell you these details are because they don't matter. Who cares about the past of these scientists? Does it really matter why MacReady knows how to use a flamethrower? Is it essential to the plot where the alien comes from? What exactly are the rules the alien follows (Something I, to this day, don't wholly understand myself)? The answer, of course, is who cares?
Which is why, at the very end, after the base has exploded and MacReady has seemingly destroyed the base and the alien inside, Childs approaches, absent for most of the final act of the movie. Mac asks where he was, and Childs replies that he was out in a blizzard looking for what he thought was another scientist. The wind begins to howl, and the audience is left wondering which man is one of the aliens, if either is. Both have no weapons to attack the other with, and the storm means certain death for them both. The camera pans out, and the true identity of the survivors is left ambiguous.
The first time I saw the movie, I felt cheated. How dare I waste 109 minutes of my life and John Carpenter has the nerve to leave me guessing! I, a loyal audience member, deserve to know something for certain in a movie where nearly nothing is certain! And therein lies the genius of the film. The ending is left open not because John Carpenter is a demon who enjoys torturing his audience (although the argument could be made), and not because he couldn't think of a proper ending. The more I think about that final scene, with the two faces lit only by the slowly diminishing fire, the more I enjoy the movie as a whole. Carpenter's ending is open to all sorts of interpretation because it fits.
The whole movie keeps anybody watching close enough guessing, even on second, third, and tenth viewings. Of course, it follows that the end of the movie continues in the same vein of all that precedes it. This same formula applies to nearly any story. At the end of the landmark graphic novel Watchmen, we're left wondering whether or not Rorschach's story will ever be released to the public, or even if they will believe it. Of course, this is only appropriate because tons of detail and hidden hints are slipped into the pages that go before this final panel that even eagle-eyed readers will miss. If Macbeth ended with Macbeth and Macduff walking offstage with swords drawn, the sounds of battle clanging to stage right while the lights slowly come up and the curtains come together, the audience would feel cheated, but only because all four acts are incredibly straightforward. The landmark 1995 anime series Neon Genesis Evangelion has several plots happening simultaneously, but the movie that acts as the grand finale to the series has perhaps one of the most open endings in any series. After a confusing series of events called "human instrumentality", our protagonist Shinji Ikari and his companion Asuka are the only humans left alive on Earth, sitting on a beach surrounded by primordial ooze (that contains the whole human race) and half of the wide-eyed, smiling face of their fellow pilot Rei, who grew to titanic size during said instrumentality. This works much better than it sounds, because the whole series contains several plots that are simply never brought up, and take several close viewings to even make a fraction of rational sense.
This may sound like I'm denouncing all of these works, but I view all of them as damn near perfect in their respective formats. They use whichever form they are in successfully, and could never be perfectly transferred to another medium without losing enough to make them inferior to the original.
So the next time you finish something, and the ending leaves you thinking something to the effect of "Why did they do that?", I would recommend a bit more analysis, because there's a chance it just might fit.