The villain opposes the protagonist. The protagonist embodies the theme, the antagonist embodies the counter-theme. The climax resolves the clash between the two. This makes the antagonist the second most important character in the story.
The difference between villain and antagonist
Villains are usually antagonists though not all antagonists are villains. Villains are evil, antagonists are opposition which can be neutral in alignment or even good. Antagonists do not need to be people, they are anything and anyone that stands in the way of the protagonist and his goal.
Writing the baddie
No one is a villain in his own eyes
Stories which feature a villain are often stories about good vs evil in which the protagonist fights for the good guys and the villain is evil. The biggest mistake made in stories is creating an action-driven villain which does lots of things to block the path of the protagonist, but without a good reason. These villains simply like to do evil things, so they do evil things, so they are evil. Ask how the villain became the way he is (backstory) and why he does what he does (personal goals). Round him with humanizing attributes such as love or fear. The round villain justifies everything he does.
Tip: Give your antagonist a speech
The speech is a great way for the antagonist to state his unique point of view. The speech must be rational and compelling, displaying the logic behind his actions. Your aim as a writer is to make the reader think “He’s a baddie, but damn, he’s got a point!”.
Pressfield, S. (2016) Nobody Wants to Read Your Shit
Seger, L (1990) Creating unforgettable characters