George Lucas showed us how not to do it.
Why did Anakin Skywalker turn to the dark side? According to Lucas, because he felt like it. With the release of Revenge of the Sith, the greatest villain in storytelling history got himself an origin story that explained nothing. Vader was just meant to be Vader, apparently. He wasn’t driven to it by an impossible moral dilemma or an earnest but dark political ideology. Nor was he even a soulless machine, like the Terminator, or just plain batshit crazy, like the Joker or Hannibal Lector.
No, when the going got tough, Anakin pretty much just started murdering his friends and allies. Everyone in the audience is thinking, “What a jerk.” He’s bad, all right, but he doesn’t make sense.
It was one of the most disappointing moments in storytelling history.
How should it be done? Surprisingly, the lesson comes from a committee of writers responsible for X-Men: First Class, which has no less than six writing credits: Ashley and Edward Miller, Zack Stentz, Jane Goldman, Matthew Vaughn, Sheldon Turner, and Bryan Singer. More is better? Apparently this time.
The absurd comic book villain Magneto — although no more absurd than Darth Vader, if you compare helmets — turned to the dark side for such good reasons that I’m not sure I wouldn’t have done the same. Even though poor Professor Xavier had just been shot, and we know he’s the good one, I found myself thinking, “I don’t know, professor — I think the magnet guy might have the right idea here.”
Erik Lehnsherr is such a believable character that you never think of him as “Magneto,” and that comic book silliness is only tacked on at the (actually bitter) end. This was villainy so nuanced it doesn’t even seem to deserve the name. He chose to defend himself more aggressively. Evil? If so, it came from an impossible situation with no right answers.
And that’s how you make a villain.