There are two elements that make up every character ever – character and role.
Character refers to personality and nature, whereas role refers to the function and purpose that characters have in the grand scheme of things.
The two are of equal importance when crafting a literary character, and can be used to compliment or deflect each other in your writing.
For example, if you’re writing a suspense or mystery and do not wish to reveal who is the antagonist until toward the end of your story, you wouldn’t weave the antagonist’s vices and malicious intent into the literature in a way that blatantly exposes his/her role; not until you want to expose him/her. You would hide the antagonist’s purpose by masking his/her true character until a climactic confrontation is due, and you’d do that by sugar-coating the antagonist’s behavior and actions or completely keeping him/her out of the spotlight until it’s convenient for him/her to come out of the shadows.
A great example is Bellwether, the sheep, from Disney’s Zootopia; she was undermined and sugar-coated to the tee, until the plot had come to a point when her malicious intent was convenient to expose.
If you were writing general fiction, romance, comedy, or any other non-mysterious genre, however, you would probably attribute vices and shortcomings (features archetypal to “bad guys”) to your antagonist from the get-go, because the idea is not for the reader to wonder who the antagonist is, but rather how the conflict between the hero and him/her will be resolved.
The complimenting or contrast of character and role depend wholly on the genre of the story and/or the shock value of its plot.
Next time you’re writing fiction and want to add a unique flare to it, try exploring and tapping into characters’ dualities in the literature. When the conflicting layers of one’s personality cause him/her to act out, chaos will ensue in their world and it will throw off readers. Nothing’s grabs readers’ attentions quite like dramatic tension, no pun intended.