The Aleinu prayer originally entered the liturgy as part of the Rosh HaShana Musaf, where it remains; but for centuries, Aleinu has also been the closing of each daily prayer year around. A tradition mentioned in the Kol Bo (siman 16) suggests that Aleinu was originated by Yehoshua after he conquered Yericho.
It is instructive to compare Aleinu with the "Song of the Sea" sung by Moshe and the children of Israel after HaShem inundated the Egyptian soldiers at the Reed Sea. At that stage in our history, the Jewish people were still at an immature stage of faith in G-d. One tradition states that the Jews in Egypt were sunken into "forty-nine gates of impurity" in their religious faith; and the forty-nine days from the Exodus until the giving of the Torah on Mount Sinai correspond to the forty nine levels they had to ascend until they were fit to receive the Torah (Responsa Chatam Sofer VII:42, Divrei Chachamim OC 99).
The Song of the Sea is written in a style which speaks even to that level of faith. It refers to HaShem as "a man of war", and describes in detail how He avenged Himself of the Egyptian soldiers, and cast terror on the nations of Canaan.
But the Jews who entered Eretz Yisrael forty years later were a far different nation. After encountering the revelation on Mount Sinai and then the rest of the Torah, after daily experiencing G-d's providence directly through the manna, this nation - most of whom had never experienced servitude and had never even seen pagan worship - was at a high level of religious faith. Therefore, their reaction to HaShem's providence is quite different. Of course they too experienced a miraculous parting of the waters and destruction of our enemies. But their response is a prayer of thanks of a quite different character.
Whereas the Song of the Sea repeatedly emphasizes that "this is my G-d", in Aleinu we further acknowledge that HaShem is "the Master of all".
In the song of the sea the special status of the Jewish people is attributed to G-d's election - "You have guided in your kindness the people You have redeemed". But in the Aleinu prayer we are already able to discern that we have a special, inherent spiritual elevation as Jews, and we thank G-d that He has not made us like the pagan nations.
In Egypt, where there was some danger that the children of Israel might attach importance to the Egyptian gods, it was important for G-d to make clear that he would do judgment on the gods of Egypt (Shemot 12:12). And in the Song of the Sea we asked, "Who is like unto You, HaShem, among gods?" (Shemot 15:11). But in Aleinu, we were able to forthrightly acknowledge that the pagan gods have no reality at all - "for they bow down to vanity and emptiness".
If we look at the expectations for the future, we see a similar contrast. In the Song of the Sea, our hopes are for HaShem to guide us to "Your dwelling of holiness" (15:13), or to "the mountain of Your inheritance" (15:17). But in Aleinu, we look forward to a more universal expression of HaShem's sovereignty — "to repair the world in the kingdom of He Who set a boundary to the earth", to a time when "all flesh will call Your name".
The Aleinu prayer of Yehoshua came at the end of the forty year process of preparing for complete Jewish nation- hood - not at the beginning.
Likewise, the daily Aleinu prayer comes at the end of the prayer service, not at the beginning. Indeed, in the introductory p’sukei d’zimra section of the prayer, we recite the Song of the Sea. The message here is that while Judaism does embrace a universalistic message, we maintain that the route to this vision is only through particularism. When we rise in the morning, we say the morning benedictions which focus on the individual. When a person is secure in his individual identity, then he is able to focus on his place within the Jewish people, chosen by G-d, as we recite the Song of the Sea. When we have attained the highest level of spiritual purification, after the completion of our prayers, then it is indeed appropriate to expand our horizons yet again and turn our attention to the perfection of the world as a whole and to the brother- hood of mankind, looking forward to the time when "On that day HaShem will be one and His name one".
Rabbi Meir's book Meaning in Mitzvot is now available as an e-book through Amazon, ibooks, Google Play and B&N.