We're all so used to seeing the good guy win at the end of films, but in reality, it just seems unrealistic, and so often, tacked on to satisfy more casual audiences who simply want pure, silly escapism. That's precisely why the films that dare to mess with the formula leave the most profoundly memorable wounds.
The moral switcheroo legitimately counts as one of the industry's greatest magic tricks. Even when it would be ridiculous for the good guy to suddenly become over-powered and take down a quasi-deity, to actually see evil prevail remains one of those moments that makes you catch your breath.
And thanks to the rise of anti-heroes and charismatic villains - who often have more dimensions than those who are wholly good (the old Batman vs Superman dynamic) - the effect can also often be entirely welcome. It's not just a case of feeling robbed by the bad guy winning:some movies that follow that trend still leave the audiencefeeling satisfied, arguably more so than had everything been neatly tied up.
It goes without saying, of course, that massive spoilers lie ahead...