The first time we see Darth Vader doing more than heavy breathing in Star Wars (1977), he’s strangling a man to death. A few scenes later, he’s blowing up a planet. He kills his subordinates, chokes people with his mind, does all kinds of things a good guy would never do. But then the nature of a bad guy is that he does things a good guy would never do. Good guys don’t just fight for personal gain: they fight for what’s right – their values.

This moral physics underlies not just Star Wars, but also film series such as The Lord of the Rings (2001-3) and X-Men (2000-), as well as most Disney cartoons. Virtually all our mass-culture narratives based on folklore have the same structure: good guys battle bad guys for the moral future of society. These tropes are all over our movies and comic books, in Narnia and at Hogwarts, and yet they don’t exist in any folktales, myths or ancient epics. In Marvel comics, Thor has to be worthy of his hammer, and he proves his worth with moral qualities. But in ancient myth, Thor is a god with powers and motives beyond any such idea as ‘worthiness’.

In old folktales, no one fights for values. Individual stories might show the virtues of honesty or hospitality, but there’s no agreement among folktales about which actions are good or bad. When characters get their comeuppance for disobeying advice, for example, there is likely another similar story in which the protagonist survives only because he disobeys advice. Defending a consistent set of values is so central to the logic of newer plots that the stories themselves are often reshaped to create values for characters such as Thor and Loki – who in the 16th-century Icelandic Edda had personalities rather than consistent moral orientations.

Stories from an oral tradition never have anything like a modern good guy or bad guy in them, despite their reputation for being moralising. In stories such as Jack and the Beanstalk or Sleeping Beauty, just who is the good guy? Jack is the protagonist we’re meant to root for, yet he has no ethical justification for stealing the giant’s things. Does Sleeping Beauty care about goodness? Does anyone fight crime? Even tales that can be made to seem like they are about good versus evil, such as the story of Cinderella, do not hinge on so simple a moral dichotomy. In traditional oral versions, Cinderella merely needs to be beautiful to make the story work. In the Three Little Pigs, neither pigs nor wolf deploy tactics that the other side wouldn’t stoop to. It’s just a question of who gets dinner first, not good versus evil.

The situation is more complex in epics such as The Iliad, which does have two ‘teams’, as well as characters who wrestle with moral meanings. But the teams don’t represent the clash of two sets of values in the same way that modern good guys and bad guys do. Neither Achilles nor Hector stands for values that the other side cannot abide, nor are they fighting to protect the world from the other team. They don’t symbolise anything but themselves and, though they talk about war often, they never cite their values as the reason to fight the good fight. The ostensibly moral face-off between good and evil is a recent invention that evolved in concert with modern nationalism – and, ultimately, it gives voice to a political vision not an ethical one.

Most folklore scholarship since the Second World War has been concerned with archetypes or commonalities among folktales, the implicit drive being that if the myths and stories of all nations had more in common than divided them, then people of all nations could likewise have more in common than divides us. It was a radical idea, when earlier folktales had been published specifically to show how people in one nation were unlike those in another.

In her study of folklore From the Beast to the Blonde (1995), the English author and critic Marina Warner rejects a reading of folktales, popularised by the American child psychologist Bruno Bettelheim, as a set of analogies for our psychological and developmental struggles. Warner argues instead that external circumstances make these stories resonate with readers and listeners through the centuries. Still, both scholars want to trace the common tropes of folktales and fairytales insofar as they stay the same, or similar, through the centuries.

Novelists and filmmakers who base their work on folklore also seem to focus on commonalities. George Lucas very explicitly based Star Wars on Joseph Campbell’s book The Hero with a Thousand Faces (1949), which describes the journey of a figure such as Luke Skywalker as a human universal. J R R Tolkien used his scholarship of Old English epics to recast the stories in an alternative, timeless landscape; and many comic books explicitly or implicitly recycle the ancient myths and legends, keeping alive story threads shared by stories new and old, or that old stories from different societies around the world share with each other.

Less discussed is the historic shift that altered the nature of so many of our modern retellings of folklore, to wit: the idea that people on opposite sides of conflicts have different moral qualities, and fight over their values. That shift lies in the good guy/bad guy dichotomy, where people no longer fight over who gets dinner, or who gets Helen of Troy, but over who gets to change or improve society’s values. Good guys stand up for what they believe in, and are willing to die for a cause. This trope is so omnipresent in our modern stories, movies, books, even our political metaphors, that it is sometimes difficult to see how new it is, or how bizarre it looks, considered in light of either ethics or storytelling.

When the Grimm brothers wrote down their local folktales in the 19th century, their aim was to use them to define the German Volk, and unite the German people into a modern nation. The Grimms were students of the philosophy of Johann Gottfried von Herder, who emphasised the role of language and folk traditions in defining values. In his Treatise on the Origin of Language (1772), von Herder argued that language was ‘a natural organ of the understanding’, and that the German patriotic spirit resided in the way that the nation’s language and history developed over time. Von Herder and the Grimms were proponents of the then-new idea that the citizens of a nation should be bound by a common set of values, not by kinship or land use. For the Grimms, stories such as Godfather Death, or the Knapsack, the Hat and the Horn, revealed the pure form of thought that arose from their language.

The corollary of uniting the Volk through a storified set of essential characteristics and values is that those outside the culture were seen as lacking the values Germans considered their own. Von Herder might have understood the potential for mass violence in this idea, because he praised the wonderful variety of human cultures: specifically, he believed that German Jews should have equal rights to German Christians. Still, the nationalist potential of the Grimm brothers’ project was gradually amplified as its influence spread across Europe, and folklorists began writing books of national folklore specifically to define their own national character. Not least, many modern nations went on to realise the explosive possibilities for abuse in a mode of thinking that casts ‘the other’ as a kind of moral monster.

In her book The Hard Facts of the Grimms’ Fairy Tales (1987), the American scholar Maria Tatar remarks on the way that Wilhelm Grimm would slip in, say, adages about the importance of keeping promises. She argued that: ‘Rather than coming to terms with the absence of a moral order … he persisted in adding moral pronouncements even where there was no moral.’ Such additions established the idea that it was values (not just dinner) at stake in the conflicts that these stories dramatised. No doubt the Grimms’ additions influenced Bettelheim, Campbell and other folklorists who argued for the inherent morality of folktales, even if they had not always been told as moral fables.

As part of this new nationalist consciousness, other authors started changing the old stories to make a moral distinction between, for example, Robin Hood and the Sheriff of Nottingham. Before Joseph Ritson’s 1795 retelling of these legends, earlier written stories about the outlaw mostly showed him carousing in the forest with his merry men. He didn’t rob from the rich to give to the poor until Ritson’s version – written to inspire a British populist uprising after the French Revolution. Ritson’s rendering was so popular that modern retellings of Robin Hood, such as Disney’s 1973 cartoon or the film Prince of Thieves (1991) are more centrally about outlaw moral obligations than outlaw hijinks. The Sheriff of Nottingham was transformed from a simple antagonist to someone who symbolised the abuses of power against the powerless. Even within a single nation (Robin Hood), or a single household (Cinderella), every scale of conflict was restaged as a conflict of values.

Neither the Greeks nor the Trojans stand for some set of human strengths or frailties

Or consider the legend of King Arthur. In the 12th century, poets writing about him were often French, like Chrétien de Troyes, because King Arthur wasn’t yet closely associated with the soul of Britain. What’s more, his adversaries were often, literally, monsters, rather than people who symbolised moral weaknesses. By the early 19th century, when Tennyson wrote Idylls of the King, King Arthur becomes an ideal of a specifically British manhood, and he battles human characters who represent moral frailties. By the 20th century, the word ‘Camelot’ came to mean a kingdom too idealistic to survive on Earth.

Once the idea of national values entered our storytelling, the peculiar moral physics underlying the phenomenon of good guys versus bad guys has been remarkably consistent. One telling feature is that characters frequently change sides in conflicts: if a character’s identity resides in his values, then when he changes his mind about a moral question, he is essentially swapping sides, or defecting. This is not always acknowledged. For example, when in the PBS series Power of Myth (1988) the journalist Bill Moyers discussed with Campbell how many ancient tropes Star Wars deployed, they didn’t consider how bizarre it would have seemed to the ancient storytellers had Darth Vader changed his mind about anger and hatred, and switched sides in his war with Luke and the Rebels. Contrast this with The Iliad, where Achilles doesn’t become Trojan when he is angry at Agamemnon. Neither the Greeks nor the Trojans stand for some set of human strengths or frailties. Since their conflict is not a metaphor for some internal battle of anger versus love, switching sides because of a transport of feeling would be incoherent. In Star Wars, the opposing teams each represent a set of human properties. What side Darth Vader fights on is therefore absolutely dependent on whether anger or love is foremost in his heart.

Bad guys change their minds and become good in exactly the same way in countless, ostensibly folkloric, modern stories: The Lord of the Rings, Buffy the Vampire Slayer (1997-2003), the Harry Potter series (1997-2007). When a bad character has a change of heart, it’s always a cathartic emotional moment – since what’s at stake for a character is losing the central part of his identity. Another peculiarity in the moral physics of good guys versus bad is that bad guys have no loyalty and routinely punish their own; whether it’s the Sheriff of Nottingham starving his own people or Darth Vader killing his subordinates, bad guys are cavalier with human life, and they rebuke their allies for petty transgressions. This has been true since the earliest modern bad guys, though it scarcely exists among older adversaries who might be hungry for human flesh, but don’t kill their own.

Good guys, on the other hand, accept all applicants into the fold, and prove their loyalty even when their teammates transgress. Consider Friar Tuck getting drunk on ale while Robin Hood looks the other way. Or Luke Skywalker welcoming the roguish Han Solo on side. Good guys work with rogues, oddballs and ex-bad guys, plus their battles often hinge on someone who was treated badly by the bad guys crossing over and becoming a good guy. Forgiving characters their wicked deeds is an emotional climax in many good guy/bad guy stories. Indeed, it’s essential that the good side is a motley crew that will never, ever reject a fellow footsoldier.

Again, this is a point of pride that seems incoherent in the context of pre-modern storytelling. Not only do people in ancient stories not switch sides in fights but Achilles, say, would never win because his army was composed of the rejects from the Trojans’. In old stories, great warriors aren’t scrappy recruits, there for the moral education: they’re experts.

Stories about good guys and bad guys that are implicitly moral – in the sense that they invest an individual’s entire social identity in him not changing his mind about a moral issue – perversely end up discouraging any moral deliberation. Instead of anguishing over multidimensional characters in conflict – as we find in The Iliad, or the Mahabharata or Hamlet – such stories rigidly categorise people according to the values they symbolise, flattening all the deliberation and imagination of ethical action into a single thumbs up or thumbs down. Either a person is acceptable for Team Good, or he belongs to Team Evil.

Good guy/bad guy narratives might not possess any moral sophistication, but they do promote social stability, and they’re useful for getting people to sign up for armies and fight in wars with other nations. Their values feel like morality, and the association with folklore and mythology lends them a patina of legitimacy, but still, they don’t arise from a moral vision. They are rooted instead in a political vision, which is why they don’t help us deliberate, or think more deeply about the meanings of our actions. Like the original Grimm stories, they’re a political tool designed to bind nations together.

The idea that whole categories of people should be locked up made the concentration camps possible

It’s no coincidence that good guy/bad guy movies, comic books and games have large, impassioned and volatile fandoms – even the word ‘fandom’ suggests the idea of a nation, or kingdom. What’s more, the moral physics of these stories about superheroes fighting the good fight, or battling to save the world, does not commend genuine empowerment. The one thing the good guys teach us is that people on the other team aren’t like us. In fact, they’re so bad, and the stakes are so high, that we have to forgive every transgression by our own team in order to win.

When I talked with Andrea Pitzer, the author of One Long Night: A Global History of Concentration Camps (2017), about the rise of the idea that people on opposite sides of conflicts have different moral qualities, she told me: ‘Three inventions collided to make concentration camps possible: barbed wire, automatic weapons, and the belief that whole categories of people should be locked up.’ When we read, watch and tell stories of good guys warring against bad guys, we are essentially persuading ourselves that our opponents would not be fighting us, indeed they would not be on the other team at all, if they had any loyalty or valued human life. In short, we are rehearsing the idea that moral qualities belong to categories of people rather than individuals. It is the Grimms’ and von Herder’s vision taken to its logical nationalist conclusion that implies that ‘categories of people should be locked up’.

Watching Wonder Woman at the end of the 2017 movie give a speech about preemptively forgiving ‘humanity’ for all the inevitable offences of the Second World War, I was reminded yet again that stories of good guys and bad guys actively make a virtue of letting the home team in a conflict get away with any expedient atrocity.