Every memorable villain needs a good backstory. Anime villains with compelling backstories end up being just as, if not more so, engaging as their heroic counterparts. Since many anime stories are told through multiple episodes, anime villain backstories receive plenty of fleshing out. It's easier to find Mao from Code Geass a more sympathetic anime villain after learning how another character exploits him.
That said, plenty of backstories fail to make the character's evil actions forgivable, though they might illuminate something else about the character's motives and/or the story's theme. Nothing excuses Monster's Johan Liebert serial killings, but when understand the horrors of his childhood, they at least make a lot more sense. A fleshed-out anime villain gives a movie or a series an added depth. Just because they're bad guys doesn't mean their stories need to be too.
Hiei, a male fire demon, is born into an isolated group of female ice demons. Though ice demons tend to reproduce asexually, resulting in female clones, they are capable of sexual reproduction; his mother's affair with a fire demon resulted in Hiei's birth. In order to maintain the clan's monoculture, they throw the young fire demon off of a mountain at birth. A group of bandits end up saving and raising the young demon, who quickly learned to enjoy committing crimes. He flaunts the valuable Tear Stone his mother left with him, encouraging people to try and steal it so he may lure them to their demise. Hiei loved murder, and his background didn't really excuse that.
But Hiei willingly takes a major hit to his powers by getting the Jagen Eye surgically implanted into his forehead. This eye allows him to find his former village. At first, he just wants to find a jewel he lost in the area, but when he learned of a twin sister who had left the village to search for him, he changed his priorities and decided to look after her. For the first time, Hiei actually cares about another person.
Nearly every villain in Naruto boasts a compelling backstory, but Obito Uchiha's is one of the most powerful.
As a child, Obito lived as a happy-go-lucky kid with a personality similar to Naruto's. When a mission goes terribly wrong and half of his body gets crushed under a rock, his teammates Rin and Kakashi fail to rescue him and leave him for dead. Before doing so, Obito gave Kakashi his eyeball, which contained a powerful ability called the sharingan.
But Obito does not die - his ancestor Madara rescues him, replaces half his body with cloned plant material, and keeps him underground for a year while he recovers from his injuries. All the while, Madara convinces him the rest of the immoral world deserves to be destroyed. Obito doesn't believe him until Madara devises a truly horrifying situation - he implants a tailed beast into Obito's former teammate and crush Rin, then leads Obito to the place where Rin would force Obito's best friend, Kakashi, to kill her and prevent the beast from destroying the village.
Obito doesn't realize Madara manipulated the situation, or that Rin sacrificed herself. He only understands that his best friend murdered his other best friend. Now, he's ready to destroy the world alongside Madara.
Team Rocket consists of Jessie, James, and Meowth, three small-time crooks whose eternal goal is to steal people's Pokémon. You might not expect villains like this to get backstories at all, but all three of them hail from unique backgrounds explaining why they joined Team Rocket and remain a team after all these years.
James came from a wealthy family who showered him with material goods but no individual affection, eventually running away to avoid an arranged marriage. For him, being in Team Rocket allows him the freedom his family never allotted him, along with a chance to rebel against "high society." Meanwhile, Jessie was born to high ranking Team Rocket official, but ended up in foster care when her mother leaves on a mission to find Mew. For her, the criminal organization is her birthright - one she often fails to live up to, just as James does to his. Meowth learned to talk in order to impress a fellow Pokémon, but was rejected as a freak. In Team Rocket, he finds a family who won't reject him no matter what.
As a child, Johan and his twin sister Anna were born as the result of a eugenics experiment reminiscent of those run by Nazis. The goal of the experiment intended to create a child with flawless intelligence, appearance, and leadership skills. His mother is forced to choose one twin to send away for experimentation, and she nearly chose Johan, but then changed her mind and sent Anna instead. Eventually, the twins are reunited, but forced to live alone. This starts a chain reaction of time spent starving to death and time spent in multiple orphanages and foster homes.
When Johan dislikes his situation, he changes it by killing everyone involved. When he's staying at the Kinderheim 511, he manipulates the children and staff into a series of death matches, then uses the chaos to slip away, burning down the building in the process. When he thinks Franz Bonaparta, the man who headed the original experiment, intends going to take him and his sister back, he kills his foster parents and manipulates his sister into shooting him to throw off investigators. That's when he meets Dr. Tenma, who operates on his wounds at the expense of his own career - and where the story of Monster really begins.