Anakin Skywalker (Darth Vader) is one of the most iconic characters in the Star Wars franchise. John Williams created the leitmotif(s) for him very carefully as to express the character and nature of his personality. A leitmotif is a reoccurring theme that resembles or exemplifies the character in the deepest of all aspects. John Williams is a master at the craft of creating the best possible themes for characters in films. For Anakin/ Darth Vader he has done just that. It is clear that he had to create two separate themes for this one individual since when he became Darth Vader he was no longer that Jedi he once was. Let’s take a look at each of these themes at the musical level.
Anakin Skywalker was an unstable character. He was always conflicted but yet had desires. The leitmotif is structured in the key of E major. A major key makes sense as Anakin was basically a good person, however never stable. Therefore Williams created the melodic line with an unstable harmonic progression. It seems to change key, but yet it does not. It is chromatic in nature and with a hint of the Darth Vader theme in the basic melodic structure. Perhaps this is how he shows that anger inside of Anakin (the Vader in him). At the final 3 measures of the theme there is more than a hint of the Vader Theme. It is melodically , rhythmically and harmonically familiar to the Darth Vader theme, expressing his destiny.
The Darth Vader Theme (also known as the Imperial March Theme) is a total opposite of the Anakin theme. The tonal center is G minor and even though it is chromatic in nature, the theme is much more stable harmonically. There is a clear goal in the thematic material. We know where it’s headed and we know there is a clear and stable stride in the march like theme. Even though we know that Vader was still as conflicted as he was when he was Anakin, he still had a clear vision of what he wanted. He had hate in his heart and through this hate he went to gain what he wanted. The theme sounds very dark and a minor key was clearly the best choice.
Of course we know that the Vader theme was composed 20 or so years prior to the Anakin theme, but still if you look at them both the Vader theme is sprung organically from the Anakin theme. The Anakin theme is in E major and the Vader theme is in G minor. Traditionally the iii of E Major is G# minor, but that is not far off from G minor (the actual iii of E major). Therefore a key change from the Tonic (I) to the mediant (iii) seems to be happening. I am not sure if Williams was thinking of a modulation or not, but it can viewed that the Darth Vader theme is the iii of the tonic of the Anakin theme. Major as to the light side and minor to the dark side.