2. In the beginning, the ten tribes will be redeemed, and afterwards, the tribe of Yehuda [will follow](**). Afterwards will be the generation of the wilderness (Shir Hashirim 6:4)(*).
(*) The twelve middle blessings of the prayer are ordered as four times three. The first three are Torah, Teshuva, which is service, and forgiveness. These are three - Torah, positive commandments and negative commandments (***); hence, all is included. Afterwards are the blessings of redemption, healing, and blessing. Redemption is through Torah... Healing corresponds to the mitzvah of circumcision (Megillah, beginning of Ch. 2), which includes all the positive commandments. The blessing of material wealth (bircas hashanim) corresponds to the 365 negative commandments (Makkos 23 - they correspond to the 365 days of the year) (****). The next three speak of the future redemption through the two Moshiachs, Moshiach ben Yosef and Moshiach ben Dovid, and Shilo, which is reference to Moshe (as is stated by רע"מ in tractate Avodah Zara 77B, Tikkunei Zohar 36:3, 43:1 and later siman 6). This is all for the purposes of Above, for the redemption and the rebuilding of Jerusalem can not be until all the levels are complete (Gra's explanation of Megillah, beginning of the second chapter, see there where he speaks at length). The main redemption will be through Moshe (*****), that he will be revealed and redeem as in Egypt, like it says (Koheles 1), "מה שהיה הוא שיהיה - That which was, is what shall be..." The beginning letter of each word spells Moshe (משה) (Tikkunei Zohar 57:3, Raya Mehemna 23:1).
(**) This is very interesting because we find that there are two stages in the Geulah process. The first is the stage of the initial ingathering, which is later followed by a second ingathering. The first is referred to as קימה, the rising, and corresponds to Yosef. In Yosef's dream, this was represented by the fact that his sheaf rose (קמה אלומתי). This is also connected to the idea of שבע יפול צדיק וקם. Yosef (and the Jewish people, as well) is the צדיק, and although he is faced with many challenges, eventually he rises up. This corresponds to the return of the ten tribes, who were led by the tribe of Efraim, one of the two tribes of Yosef. This stage is also referred to as the פקידה, the initial stage of Hashem remembering His people and starting the process of redemption (See the sefer Acharis Ke'reshis p. 55 where he quotes from the Ramchal). This stage is referred to by Yosef himself when he commands his brothers to bring his bones to Eretz Yisrael. It seems that this stage (in the current Geulah process) came into full effect in the first half of the twentieth century, culminating in the official recognition of Israel as the Jewish homeland. The year 5708 (1948) was the end of the fifth hour, and the beginning of the sixth hour on the cosmic clock. According to the Gemara in Sanhedrin (38), the fifth hour was the hour that Adam Harishon 'stood up.' The collective soul of the Jewish people is the soul of Adam Harishon, and thus, we experienced that rise again in the fifth hour (1907-1948), culminating at its very end. In that year, over 600,000 Jews returned to Eretz Yisrael, and a similar mass immigration occurred again in 1967. It would seem likely, based on what the Gr'a is saying here, that those who have returned in the first stage of the Geulah process, that continues until now, are reincarnations of the original ten tribes. The second stage, which is referred to as the זכירה, will see the return of the entire Jewish people from all over the world. This is the second wave of the ingathering, that the Gr'a refers to as the return of the tribe of Yehuda. It would seem likely that this will be completed by the Moshiach from Yehuda, namely Moshiach ben Dovid.
It is interesting that the study of Kabbalah and the secrets of the Torah is something which is more openly accepted in Eretz Yisrael. This is specifically noticeable (as I recently saw mentioned in a Torah publication) on the holiday of Lag B'omer. This day celebrates the revelations of R' Shimon Bar Yochai, the author of the Zohar. This day is celebrated throughout the country by all stripes of Jews. This is especially remarkable because Yosef is referred to as צפנת פענח, The revealer of secrets (see Kol Hator 5:7). It would make a lot of sense that the current residents of Israel, who have been gathered through the Moshiach ben Yosef process, would be more openly connected to the hidden aspects of the Torah. This also connects to the concept of כי מציון תצא תורה - from Tzion will come forth Torah. ציון has the same Gematria as יוסף (as per Kol Hator).
(***) As the Gr'a says, the positive commandments correspond to the concept of Moshiach ben Yosef, who is involved in active tikkun, whereas the negative commandments correspond to the concept of Moshiach ben Dovid, who is involved in the original tikkun which Adam was supposed to do before the sin. This tikkun is passive, like the mitzvah of Adam which was not to eat of the tree of knowledge of good and evil. This is also clear as R' Maltzin continues and states that healing corresponds to circumcision. This is a clear reference to Moshiach ben Yosef, the one who had mastery over his sexual passion. This is the main tikkun of our current age, the tikkun habris. This is one of the reasons why, as we get closer and closer to the final tikkun of Yosef, the challenge in this area gets greater and greater. This is one of the main tikkunim of the internet, which, like Yosef, is meant to act as a connector for the entire world, but has the potential to present very difficult challenges in the area of sexual passion. This is a challenge we must face up to right now, and overcome! This is the challenge that separates the men from the boys (based on a concept I heard from my Rosh Yeshiva, Rabbi Perr).
(****) Material prosperity is the concept that corresponds to Malchus and the concept of Moshiach ben Dovid. It is the vessel through which we can accomplish spiritually, because אם אין קמח, אין תורה - if there is no flour, there is no Torah. When one does not have to worry about his finances, he can devote his entire being to spirituality. This is why one of the major challenges in chutz la'aretz, which corresponds to the tribe of Yehuda and Moshiach ben Dovid, is the disproportional desire for wealth. Wealth can be a means for one to be able to accomplish his spiritual needs, but only if it does not become an end unto itself.
(*****) R' Shimon Kessin discusses why Moshe returns, if he seems to have been just another failed Moshiach ben Yosef. He explains that Moshe did not fail. He succeeded in bringing the bride (Klal Yisrael) to the wedding canopy. Thus, Moshe aided the completion of the marriage, as it were, of Hashem and the Jewish people. The Jewish people were then like a bride who committed adultery at the wedding, but nevertheless, they had a relationship with Hashem that could never be broken. Thus, Moshe succeeded in helping the consummation of the marriage, as it were, and he returns to complete the job he began so many years ago.