We are told that as part of the Yom Kippur sacrificial ritual in the Tabernacle/Temple, the High Priest must take two goats:
…and place them before G‑d at the entrance of the tent of meeting. Aaron will place lots on the two goats, one lot "for G‑d" and one lot "for Azazel". Aaron will take the goat on which the lot fell "for G‑d" and make it a sin-offering. The goat on which fell the lot "for Azazel" will be positioned live before G‑d to make atonement on it, to send it to Azazel into the desert. (Lev. 16:7-10)

The plain meaning of "Azazel" is a cliff; the goat sent to Azazel was thrown off a desert cliff to its death. (See Rashi on Lev. 16:8-10)

The mystical significance of Azazel is 'Satan' and the Nukvah of the luminous [shell], to whom the goat is given. They ['Satan' and the evil Nukvah], the male and female [principles of evil], are also called "the depths of the sea" - what remains after the dross of the kings [of Edom] are purified - and "the shadow of death".

As we have seen previously, 'Satan' is the name given to the evil partzuf of Zeir Anpin. Just as the partzufim exist in each of the four holy worlds, so do they exist in each of the four realms of evil. The four realms of evil are called "shells", contrasting with the fruit or meat of the nut within the shell, which signifies the holy realms. The significance of this imagery is that, just as the shell, which obscures the fruit within it, is inedible and must be discarded, so does evil obscure the power of holiness in the world; we must break through it and reject it in order to reveal goodness. On the other hand, just as the shell protects the fruit within it until it is ripe, so does evil (i.e. egocentricity) serve the purpose of protecting the good within it until it is ripe.

The fourth realm…can be absorbed and elevated into holiness…

Three of the four realms of evil are totally unable to be assimilated. The fourth realm is neutral, meaning that although it is a priori evil, meaning that it is evil only insomuch as it is not oriented by nature toward G‑d. If it is used for holy purposes, however, it can be absorbed and elevated into holiness. Conversely, if it is used for evil purposes, it descends into and becomes part of the three unholy realms. This neutral realm of evil is called the "luminous shell".

These four realms of evil are all alluded to in the vision of Ezekiel: "I saw, and behold, there was (1) a stormy wind coming from the north, (2) a great cloud, and (3) a flashing fire, and (4) a luminescence surrounding it…." (Ezekiel 1:4)

The "depths of the sea" refers to the verse, "He will return, He will have mercy on us; He will conquer our iniquities and cast all their sins into the depths of the sea." (Micah 7:19) The phrase "the shadow of depth" refers (among others) to the verse, "Even though I walk through the valley of the shadow of death, I will fear no evil; Your rod and Your staff comfort me." (Psalms 23:4) As we will see, the Hebrew for these two phrases consists of the same letters.

The "kings of Edom" refers, as we have seen in other writings of the Ari, to the sefirot of the world of Tohu, which collapsed. The portions of these sefirot that were refined enough to be assimilated into holiness in the subsequently constructed world of Tikun became the sefirot of that world, while those elements that were too crass to be so assimilated became the realms of evil.

[This evil] is transformed into the defending counsel [for the Jews on Yom Kippur] by virtue of the good presented within it, as explained in the Zohar. (III:101)

This process will be explained here shortly.

Now, these two goats are [mystically] the equivalent of the two spies, chochma and bina of the evil Zeir Anpin of Atzilut, as mentioned there. (See also Zohar II:178b and 3:60b.)

The two spies Joshua sent to spy out the land of Israel correspond to chochma and bina of the evil Zeir Anpin (i.e. 'Satan').

The [goat/spy] of chochma is [a priori] more sweetened; this is why one lot is for G‑d. In contrast, the second [goat/spy], which is sent to die, manifests bina of [the evil] Zeir Anpin.

The experience of chochma is selflessness…

Since the experience of chochma is selflessness, there is some good in it even in a non-holy context. For example, if a person is laboring over some mathematical problem and is totally absorbed in thought over it, he is not focused on G‑d, but neither is he focused on himself. The very fact that he is at that moment not focused on himself makes the experience one that can be transformed into holiness, if, say, the individual remembers or realizes that mathematics is, after all, our way of describing G‑d's wisdom as it has been imprinted in nature.

Bina, in contrast, is the experience of self. The insight of chochma is evaluated and analyzed in the context of the individual's personal world-view he has developed during his life. If this is done in an evil context, there is no redeeming element that could make the experience holy.

Azazel signifies 'Satan' and the Nukvah of the luminous [shell], which are positioned opposite Zeir Anpin and Nukvah of the worlds of Beriya, Yetzira, and Asiya. Since [they receive the bina-goat] they are happy.

'Satan' and Nukvah of the three lower worlds receive the evil bina of the level of Atzilut.

Since [chochma and bina of the evil Zeir Anpin of Atzilut] are called "goats" - as mentioned in the Zohar. (II:108b) Zeir Anpin and Nukvah of the luminous [shells] of Beriya, Yetzira, and Asiya, their children, are called "Aza" and "Azel".

The word for goat is "ez" (spelled ayin-zayin). The "children" of the goats of Atzilut are called "Aza" (spelled ayin-zayin-alef), a derivative, Aramaic form of "goat" and "Azel" (spelled ayin-zayin-alef-lamed), meaning "goat-god".

Together, [these two goat-offspring] are called "Azazel", just like the words for "the shadow of death" and "the depths" comprise both of them, "shadow" referring to the male and "death" to the female.

"Azazel" can thus be seen as a contraction of "Aza" and "Azel".

The word for "the shadow of death" is "tzalmavet", itself a contraction of the words for "shadow" ("tzeil") and "death" ("mavet"). The letters that form this word (tzadik-lamed-mem-vav-tav) can be permuted to spell "depths" (in Hebrew, "metzulot", spelled mem-tzadik-lamed-vav-tav).

The "shadow", or lack of light, is the active side of evil…

The "shadow", or lack of light, is the active side of evil, the obstruction of holy light, and "death" is the result or expression of this evil, i.e. being cut off from holiness, the source of life. Thus it is written, "The feet [of a forbidden woman] descend unto death." (Proverbs 5:5)

Thus, when the goat is sent to Azazel, "[G‑d] casts all their sins into the depths of the sea," (Micah 7:19) as is stated in the Zohar. (III:63)

This is so since Azazel and the "depths of the sea" are mystically synonymous, as stated.

Since these goats derive from the holy Nukvah and her leftovers, they manifest strong judgment, as stated in the Zohar. (III:41)

We have explained previously that Nukvah must evince strict judgment in order to differentiate between holiness and evil. When this judgment is exercised in an entirely evil context, however, it becomes prejudicial judgment.

Now, you know that the "luminous shell" is half good and half evil, and separates the holy realm from the evil realm. When a person transgresses a prohibition, [this neutral realm] serves to complete the three evil shells of his evil inclination, and becomes completely evil itself. This is his punishment for transgressing a prohibition.

When an element of the "luminous" shell is given over to the three completely evil shells, it "completes" them into a unit of four, mirroring the four worlds of holiness. This reinforcement of his inner evil, making it a power more difficult to reckon with, is the truest punishment for evil behavior. As the sages say, "One mitzva leads to another mitzva, and one sin leads to another sin." (Avot 4:2)

'Satan'…has received the divine beneficence…present in the goodness of that goat…

Now, on Yom Kippur, G‑d commanded us and permitted us through His good will to send 'Satan' one goat, which comprises good and bad [elements], as stated above. ['Satan'] then rejoices over the [additional power granted to the] three wholly evil shells, for [by receiving the goat] he has received the divine beneficence and life-force present in the goodness of that goat. As is known, the reason [the forces of evil] pursue holiness is so that they can enliven themselves; without [the life-force siphoned off holiness] they would die. Hence the great joy 'Satan' derives from this goat sent to Azazel, especially in light of the fact that [G‑d] gives it to him knowingly and ['Satan'] does not have to toil or exert himself [for it].

[After casting the lots over the goats] the High Priest would then confess [the sins of the Jewish people] over the goat's head. The power of this repentance would refine the portion of [the goat] associated with the world of Yetzira, separating the good [in it] from the evil. This is necessary for it is impossible for good and evil to be intermixed as they were before the sin, for, through sin, the power of evil increased, and the good would just be subdued before it.

As was stated above, good and evil are mixed together equally in the "luminous shell". Once a person sins, however, the evil is strengthened and the balance is upset. Repentance cannot be merely an attempt to return to the state of affairs that existed before the sin; it is too late.

The only avenue open is to align the potential good with actual good…

The initial innocence has been lost, and the only avenue open is to align the potential good with actual good, i.e. holiness, and let the evil that has been actualized assume its position with true evil.

For example, a kosher chocolate cake is in the realm of the "luminous shell". It is neither holy nor evil; what it will become depends on how it is used. If someone eats it for holy purposes, e.g., to add to the enjoyment of Shabbat, or to give himself a needed, temporary lift, or in order to experience the goodness of G‑d in having made delicious food, then the cake existentially enters the realm of holiness. If it is eaten for coarse purposes, e.g. to indulge in sensual pleasure, it descends into the realm of evil. The person who eats it will most likely be able to measure the purity of his intentions by the way he feels after eating the cake. To the extent that he feels uplifted or holier after eating, he succeeded in keeping his intentions pure. To the extent he feels coarser, he didn't.

This is the meaning of repentance. [Evil and good] are separated through this. Although they existed originally together in the "luminous shell", the evil has now been identified; it clings to the goat and disappears into the [realms of] complete evil. The good, meanwhile, returns to [the realm of] supernal holiness, no longer part of the "luminous shell".

'Satan'…is a fool and makes a mistake…

This is why 'Satan' rejoices. He sees that he has now been fortified [by this additional measure of energy from the "luminous shell"], and he accepts it with full consciousness. But he is a fool and makes a [fatal] mistake, for on the contrary, "he will be heaping coals on his own head" (Proverbs 25:22), meaning that evil was initially intermixed with good in the "luminous shell" and he had a strong foothold. Supernal holiness was forced to grant beneficence to the good with which this evil shared [the "luminous shell"]. This is the mystical significance of Israel's exiles amongst the idolaters.

When evil shares the "luminous shell" with good, it can more easily seduce man into sin, since it does not have to entice him into an explicit prohibition - only into using a neutral aspect of reality for egotistic purposes.

But now that evil has been separated from the good, 'Satan' has lost that portion [of divine beneficence] that was granted [to it] via the good [of the "luminous shell"]. It follows that 'Satan' has been tricked and has suffered a great loss. On the contrary, a situation that was originally complete [for him] is now the opposite. For, [as the verse paraphrased above continues:] "[G‑d] will surely reward you", meaning that the goodness [of the "luminous shell"] connects to and completes the holy soul of the person, while 'Satan' loses this good altogether.

This illustrates the tremendous power of repentance.

[Translated and adapted by Moshe-Yaakov Wisnefsky from Likutei Torah, parashat Acharei Mot; subsequently published in "Apples From the Orchard."]