In the basic person-vs-person plot, the goodness of the hero depends largely on the badness of the villain. Conversely the nastiness of the villain exists more or less in proportion to the virtue of the hero or heroine who opposes him (her).
Hence Clarice Starling's intelligence, wit, decency and basic humanity are enhanced as she contrasts them against the demented intelligence and indecency of Hannibal Lecter, one of the most cunning monsters ever to grace American books and movies. She becomes a more amazing, insightful and virtuous heroine because she is pitted against an absolutely monstrous villain, one whose cleverness we can't help admiring even as our revulsion intensifies.
Harry Potter would never have become the Hero of Hogwart's if it hadn't been for Voldemort. J.K. Rowling herself, via her character Dumbledore, even tells us that Tom Riddle created the instrument of his own destruction by seeking out and trying to destroy "the boy who lived."
The list is long. Sherlock Holmes had his Moriarty; Batman his cast of hideous bad guys. Find a hero anywhere and he is matched by a villain as evil as he is good.
The example even works in history. Gen. Dwight Eisenhower might never have become the leader he was had he lived in a time of peace. He became the commander of the Allied Forces and then the President of the United States because his leadership was shaped, honed, and polished by his conflict with Adolph Hitler and the forces of the German Third Reich, Tojo and the Axis Powers.
We who write can do well to remember this phenomenon: In a person-vs-person conflict, the hero(ine) and villain create one another as they pit their best and worst against each other.
Who are your favorite fictional villains? What heroes or heroines do they "create" through their conflict?