Animal soul
In Kabbalah, the animal soul is one of the two souls Jews possess, and the only one that gentiles have. The animal soul animates the living body and is the source of both animalistic desires and inherent Jewish traits like kindness and compassion, as noted in Tanya, a primary text of the Chabad movement and much of Hasidism, in general. While its primary inclination is to seek worldly, physical pleasures, the animal soul can be trained to primarily pursue spiritual pleasures with the guidance of the divine soul.
Transforming the animal soul
While the animal soul is still attached to worldly, physical pleasures, it is synonymous with the yetzer hara, the evil inclination. However, the nefesh habehamit is not inherently evil; it merely seeks pleasure. Through persistent, joyous exposure to Torah study and observance of mitzvot, the nefesh habehamit can be trained to desire spiritual and divine pleasures. In its refined state, it is often termed the nefesh hachiyunit, the life-giving soul, because its primary function then is to give life and energy to the body in order to study Torah and perform the mitzvot.The nefesh habehamit is typically mentioned together with the nefesh ha'elokit, the divine soul, because the nefesh habehamit and the nefesh ha'elokit are at first in opposition to each other. Chassidut teaches that every person must seek to dominate and conquer the nefesh habehamit to make it serve the nefesh ha'elokit.
Parable of the Harlot and the Prince
The nefesh habehamit actually desires to be defeated, as explained by a Zoharic parable of a king who desired to test the mettle of his son, the prince. The king hires a beautiful harlot to seduce his son, explaining to her that his goal is to test the son. She is to utilize all of her wiles and techniques to ensnare the prince, as anything less would not be a true test. However, inwardly, the harlot wants that the prince should succeed and not succumb to her.Thus, the sole purpose for evil's existence is to be defeated by mankind, and this is for people's own benefit.
Levels of conquest
The Tanya explains that it is within the power of all people to at least control the so-called "garments" of the soul. These garments are thought, speech and action, and are derived from the verse, "For it is exceedingly close to you, in your mouth and heart , to do it ." Once these three garments are wholly devoted to Torah and mitzvot, a person attains the rank of a beinoni, and this is within reach of every person.A tzadik is a person who has utterly transformed the actual emotions of the nefesh habehamit. That is, instead of changing just the external "garments" of the soul, they have transformed the soul's emotions themselves and actually feel no attachment to worldly desires. Their sole desire is for divine pleasures.
The above, however, describes an "incomplete tzadik" in whom a small remnant of evil remains. A "complete tzadik" is a person in whom the essential nature of the nefesh habehamit has been transformed, to the extent that the person "transforms the evil and elevates it to holiness", turning "darkness to light". This tzadik feels no attachment to evil.