George Lucas had always intended for Star Wars to be the story of Anakin Skywalker, a warrior of light who falls to the dark side, until ultimately finding redemption at the hands of his son, Luke.
In fact, we could argue that the main reason the creator went ahead with the idea of the prequels was to show Anakin in his early years as a hero of the Galactic Republic. But the way this narrative unraveled, especially in Revenge of the Sith, makes Vader’s actions and attitudes nonsensical.
As you recall, Palpatine used Padme’s death as the main motivator to influence Anakin and turn him to the dark side. In fact, the only reason the Chosen One proceeded to purge the Jedi and help the Empire’s rise to power was the promise that the sinister Emperor would save his loved one from certain death. It was Anakin who ultimately caused Padme to die, completing the circle as a self-fulfilling prophecy. But Vader clearly must have realized that the Emperor played him. In fact, were it not for him, his wife would still be alive.
And yet, he continues to serve the Emperor as an obedient puppet, committing countless reprehensible acts in his name. So, the question is: why didn’t he exact revenge on Palpatine for all he had done to his life?
Well, when you think about it, Star Wars pretty much confirms that Vader had already turned on Palpatine before Return of the Jedi. After Episode III, Anakin’s spirit was broken and his head was filled with trauma. In a sense, the Chosen One didn’t know if he had the strength to defeat Palpatine if he went against him. That’s why the arrival of Luke was a changing point. Vader even offered the beloved hero to join him in The Empire Strikes Back, saying that together they could kill the Emperor and rule the galaxy “as father and son.”
When Luke refused and strayed even further from his dad, though, Vader once again found himself trapped. As such, he decided to keep playing the compliant servant to save himself. It was only at the end of the last movie when Anakin resurfaced again to save his son, seemingly killing the Emperor in the process and fulfilling his destiny as the Chosen One of the living Force.