In order to write well rounded, realistic, and provocative characters, I think writers need to delve into the murk of human psychology, to pierce into the ID and stir up understanding as to what makes a person/character tick.
Some of the best villains, for instance, are the ones we can relate to, when we ask ourselves “Would I do that if I were in that situation?”. They work from their weaknesses, give into their desires, and serve a role as antagonist to the hero. Villains don’t have to be evil. They don’t have to revel in pain and misery. They might, however, feel the pain and misery of others serves their goal, and therefore ‘must be done’.
Heroes, also, can have their motivations marred. The flawed hero provides the reader recognition in their own drawbacks, and they too an overcome obstacles and save the day (or be a hero).
Motivation is key to all your character, including their development through the story. Why do they do what they do? If you don’t know why your character is doing whatever action or even dialog you imagine, you’ll need to examine this.
I think a hero is an ordinary individual who finds strength to persevere and endure in spite of overwhelming obstacles. Christopher Reeve