The Opponent, John Truby, The Anatomy of Story, p.46–47

Writers often mistakenly think of the opponent, also known as the antagonist, as the character who looks evil, sounds evil, or does evil things. This way of looking at the opponent will prevent you from ever writting a good story.
Instead you must see the opponent structurally, in terms of his function in the story. A true opponent not only wants to prevent the hero from achieving his desire but is competing with the hero for the same goal.
Notice that this way of defining the opponent organically links this step to your hero’s desire. It is only by competing for the same goal that the hero and the opponent are forced to come into direct conflict and to do so againg and again throughout the story. If you give your hero and opponent two separate goals, each one can get what he wants without coming into direct conflict. And then you have no story at all.
If you look at a number of good stories, it often appears, at first glance, that hero and opponent are not competing for the same goal. But look again. See if you can spot what they are really fighting about. For example, in a detective story, it appears that the hero wants to catch the killer and the opponent wants to get away. But they are really fighting over which version of reality everyone will believe.
The trick to creating an opponent who wants the same goal as the hero is to find the deepest level of conflict between them. Ask yourself: “what is the most important thing they are fighting about?”. That must be the focus of your story.
KEY POINT: To find the right opponent, start with your hero’s specific goal; whoever wants to keep him from getting it is an opponent.
Note that writers often talk about having a hero whose opponent is himself. This is a mistake that will cause all kinds of structural problems. When we talk about a hero fighting himself, we are really referring to a weakness within the hero.
Let’s look at some opponents.
Michael’s first opponent is Sollozzo. However, his main opponent is the more powerful Barzini, who is the hidden power behind Sollozzo and wants to bring the entire Corleone family down. Michael and Barzini compete over the survival of the Corleone family and who will control crime in New York.
Luke’s opponent is the ruthless Darth Vader, and each is competing over who will control the universe. Vader represents the evil forces of the tyranical Empire. Luke represents the forces of good, comprised of the Jedi Knights and the democratic Republic.
Like any good detective story, “Chinatown” gives us a unique and tricky opponent who remains hidden until the very end of the story. Jake’s opponent turns out to be the rich and powerful Noah Cross. Cross wants to control the future of Los Angeles with his water scheme. But he is not competing with Jake about that. Because “Chinatown” is a detective story, he and Jake are actually competing over whose version of the truth will be believed. Cross wants everyone to believe that Hollis drowned accidentally and that Evelyn’s daughter is his granddaughter. Jake wants everyone to believe that Cross killed Hollis and raped his own daughter.