The AlterRebbe (18 Elul 5505 —24 Tevet 5573  was the founder of Chabad and the author of the Shulchan Aruch Harav and the seminal Chassidic work, the Tanya.
The chassid, Reb Gershon Dovber of Pahar, told this story in the name of Rabbi Hillel of Paritch:
When the czar’s soldiers arrested the Alter Rebbe, they took him to prison via the town of Nevel. The soldier who was responsible for the Alter Rebbe became thirsty and entered the home of a Jew to drink. “We are taking your rabbi to Petersberg,” he told the Jew.
The man rushed outside to the Alter Rebbe, who said to him, “Bless me, for you are a Kohen.” Word that the Alter Rebbe was under custody in their town flew throughout Nevel and in no time, many Jews had gathered to be at the side of the Alter Rebbe.
After the Alter Rebbe was released from prison, he passed through Nevel on his way home to Lozhna. The town’s Jews arranged a major celebration in honor of the Alter Rebbe’s release.
“What do you choose?” the Alter Rebbe asked them. “Should I give over a discourse on Chassidut? Or should I tell you a story?” The townspeople understood that this was probably going to be a good story, as the Rebbe, himself had proposed it. “I will tell you how Chassidut came to the world,” said the Alter Rebbe.
Once, it became known to the Ba’al Shem Tov that there was a holy Name of God in a particular chamber in heaven and that the key to that chamber was in the hands of the samech mem (Satan).
How did the samech mem attain this holy Name? Reb Gershon Dovber heard from the chassidim that when the destruction of the second Temple was about to take place, the samech mem protested and did not agree to let it happen. His opposition was because the exile in Babylon would only be for seventy years— not enough for him. As a way of placating him, he was told that the holy Name upon which the redemption depends would be in his hands, thus giving him the power to delay the redemption. Continuing then with the Ba’al Shem Tov…
The Ba’al Shem Tov said that he would bring the samech mem down to earth and he would take the holy Name from him. “It is a great danger to bring the samech mem down,” heaven told the Ba’al Shem Tov. “I will not fear,” the Ba’al Shem Tov answered. “My father of blessed memorey told me not to fear anything but God, Himself.” And he brought the samech mem down.
“How did you dare to bring me down?” bellowed the samech mem. “From the day that the world was created I have been in the world only twice!” The samech mem was referring to once for the sin of eating from the Tree of Knowledge and a second time, for the destruction of the First Temple.
The Ba’al Shem Tov took the outer dimension of the holy Name from the samech mem. It is from this holy Name that all the teachings of Chassidut came. The inner dimension of the holy Name remained in the samech mem’s hands, until Mashiach will come, may it be speedily in our days. Mashiach will take it from him.
The samech mem had descended only twice to the world before the Ba’al Shem Tov forced him down a third time. According to this story, he will be descending another time. The samech mem, then, appears in reality four times: The first two times, he has the advantage, and the second two times, he is at a disadvantage. We can understand the inner dimension of this order if we contemplate the essential order of the four letters of God’s Name, Havayah—yud, hei, vav, and hei.
The descent at the sin of the Tree of Knowledge was a blemish in the yud of God’s Name, Havayah, alluding, according to Kabbalah, to the intellect (mochin) of Abba (Father). The very connection between God and His world was blemished when His directive was disobeyed by His creations and Adam and Eve ate of the Tree of Knowledge.
The descent at the destruction of the First Temple was a blemish in the first (also called, the upper) hei of God’s Name, Havayah, which, according to Kabbalah alludes to the mochin of Imma (Mother). The mochin of Imma is the meeting point between God and His children, in which we experience His light and integrate it into ourselves. The Jews built and adorned the Holy Temple, like a bride who decorates her home for her beloved groom. When the Temple was destroyed, that experience of connection and meeting between God and man became void, and a gaping hole opened in the souls of Israel.
The descent of the samech mem against his will, when the Ba’al Shem Tov called him, parallels the vav of God’s Name, Havayah, which alludes to the six attributes of the heart. This is the significant turning point, as the transition between the two parts of God’s Name is momentous. The first two letters of Havayah, yud and hei, are its internal, concealed dimension. They contain the light that is not revealed in the worlds as it is. The letters vav and hei take the light from the inner dimension of Havayah and bring it down into reality. This is alluded to by the shape of the letter vav, which descends like a line or chain from above to below, drawing down the nuclear point of the letter yud which is at the top of the letter vav. (A vav is actually a yud with a longer descending line).
The samech mem’s attention is mainly focused on the transition point between the inner and revealed dimensions, so as not to allow the supernal light to descend and integrate into reality. As long as everything is sealed and hidden in the form of thoughts and desires alone, it is possible to prevent their actualization by many means. But when the light finally takes on shape and form in reality, it is impossible to stuff it back into the upper realms.
The sages expressed this in their famous explanation on the verse in Exodus 17:16, “For a hand is upon the throne of Kah (י-ה)”: “Why does the verse not mention [God’s full Name] ‘Havayah’, but rather, Kah’? Said Rabbi Levi in the name of Rabbi Hama ben Rabbi Chaninah: As it were, as long as the offspring of Amalek is in the world, the Name is not complete and the throne is not complete. When the offspring of Amalek is eliminated from the world—the Name is complete and the throne is complete.”
Amalek’s (עֲמָלֵק), Esau’s grandson’s power, alluded to in the meaning of his name, which means to decapitate (לִמְלֹק), is in his ability to separate the head from the body. He knows how to prevent the light of the mochin situated in the head from descending into the heart and the organs of action. But if a holy reality has arisen and been built in the lower realms of reality, this means that the light has trickled deep into the world and has become an actual part of it. Against this Amalek has no power.
The beginning of the samech mem’s defeat is at this point. The Ba’al shem Tov is his nemesis for it is precisely at the transition between the first two letters and the final two letters that his power is so great. Chassidut illuminates life in this world with the supernal, concealed light. It is not willing to allow Godliness to remain hidden, as the samech mem desires and needs. The six attributes, which are so human and blended with good and bad, are illuminated by the Torah’s inner dimension using the light of the soul’s essence. This changes the nature of the six attributes and their humanity manifests with their purely Divine essence.
Soon we will merit the time when the samech mem will be forced to descend for his fourth and final trip to this world. Mashiach will defeat him and remove his prey from his mouth once and for all: “He has swallowed down riches, and he shall vomit them up again; God shall cast them out of his belly” (Job 20:15). This final descent parallels the final hei of God’s Name Havayah, which alludes to the sefirah of kingdom and to service of God by means of fulfilling the Torah and mitzvot in practice. It is specifically physical action in the lower realm that best expresses God’s complete kingdom and Presence in this world. Then the samech mem will give the kingdom and the control that were in his hands back and by doing so the kingdom of the King Mashiach will be reinforced.