In anime, a villain's depravity was usually intended to make the hero look better in comparison. Though sometimes given sympathetic qualities, they're meant to represent forces fundamentally opposed to the beliefs of the hero and audience. In this regard, a villain was almost as responsible for making a protagonist likable as the hero themselves.
Source:https://www.cbr.com/most-evil-anime-villains-ever-ranked/