B"H
The purpose of the Erev Rav, that left Egypt with us, was to attach to and become part of Am Yisrael in order to destroy us from within by leading us to idolatry and destroying our relationship with Hashem. They minimally achieved this with the episode of the golden calf. The result of the sin of the golden calf was the death of Moshe before entering the land and the postponement of the complete redemption. We are still waiting for the complete redemption because the sin of the golden calf hasn't been completely rectified. The erev rav are still within us, still leading us to idolatry, still damaging our relationship with Hashem and still delaying the redemption.
We have many enemies, Yishmael, Esav, Amalek but the Erev Rav is the greatest of them all because they are our leaders religious and political and they prevent us from destroying our other enemies. We must remove the Erev Rav from among us before we can destroy our enemies. We must remove the Erev Rav from among us before we can have the complete redemption.
In his book EVEN SHELOMO, the Vilna Gaon, ztk’l wrote that the selection and purification of Israel will not be complete until the Erev Rav separates from Israel completely, because they (Erev Rav) are very attached to the Jews and the Jews learn from their actions.
In the Tikkune Zohar (97a) it is written: “All the exile and the destruction of the Beit ha Mikdash and all the suffering, all of it came through Moshe’s acceptance of the Erev Rav, and all wicked people and evildoers in each generation come from them, meaning from their souls, for they are reincarnations of those who left Egypt and this is what the Gemara (Beitza 32) refers to: “They come from the Erev Rav”.
The purpose in our bringing about the ingathering of the exiles is to set up faithful people for the sake of the unification of the two moshiachs (i.e., Moshiach Ben Yosef and Moshiach Ben Dovid) in the gates of Jerusalem. This is in order to return the Divine Presence to bring about the redemption, the true redemption and sanctification of God's Name. According to our teacher, the Vilna Gaon, z"l, we can bring about, with the help of God and through these strong people, these two moshiachs, and to learn well all the levels and their purposes in practical terms. The general purpose of the two moshiachs, Moshiach Ben Yosef and Moshiach Ben Dovid, throughout all the generations has been to protect and fight against the three 'heads' of the K'lipos, Eisav, Yishmael, and the Erev Rav. The specific role of Moshiach Ben Yosef is against Eisav who is the k'lipah of the left, the main purpose of Moshiach Ben Dovid is against Yishmael, the k'lipah of the right, and together they go against Eisav and Yishmael who are the ox and the donkey from the side of impurity. The joining of Eisav and Yishmael is the result of Armelius, the sar of the Erev Rav, who are able to destroy Israel and the entire world, may God have mercy. The main drive of the Erev Rav is to unify Eisav and Yishmael and to separate the two moshiachs. Therefore, our main service and battle is to break and to remove the strength of the Erev Rav, the k'lipah of Armelius the Evil, from Israel; the Erev Rav is our greatest enemy, the one who separates the two moshiachs. The k'lipah of the Erev Rav works only through deception and roundabout ways. Therefore, the war against the Erev Rav is the most difficult and bitterest of all. We must strengthen ourselves for this war, and anyone who does not participate in the battle against the Erev Rav becomes, de facto, a partner with the k'lipah of the Erev Rav, and was better off not being born in the first place.
(Kol HaTor, Chapter 2, Section 2, Letter 'bais')