The band of Korah will not have part in the Future World and not be resurrected in the future. What is the reason? The desert covered them, in this world; they were lost from among the congregation, in the future. It was stated: Rebbi Jehudah ben Bathyra says, one understands from what is said, I erred [wandered] like a lost sheep; look after Your servant, that just as the lost object mentioned there at the end will be searched for, so also the lost object mentioned here at the end will be searched for. Who prayed for them? Rebbi Samuel bar Naḥman said, Moses prayed for them, Reuben shall live and not die. Rebbi Joshua ben Levi said, Hannah prayed for them. This follows Rebbi Joshua ben Levi, as Rebbi Joshua ben Levi said: Korah’s band was continuously sinking until Hannah stood up and said, the Eternal kills and brings to life, sends down into the pit and lifts up.
search for Your servant,
for I have not neglected Your commandments.
Her worth is far beyond that of rubies.
(18) She sees (lit. "tastes") that her business thrives; Her lamp never goes out at night.
(ה) (משלי לא כט): "רבות בנות עשו חיל": ..."טעמה כי טוב סחרה, [לא יכבה בלילה נרה]" - זו חנה, שטעמה טעם תפילה, שנאמר (שמואל א ב א): "ותתפלל חנה ותאמר עלץ לבי בה' וגו'", לפיכך זכתה ויצא ממנה בן שהיה זוג למשה ולאהרן, שהיו מאירין לישראל כנרות, דכתיב (תהלים צט ו): "משה ואהרן בכהניו, ושמואל בקוראי שמו", וכתיב ביה בשמואל (שמואל א ג ג): "ונר אלהים טרם יכבה ושמואל שוכב בהיכל ה'".
(5) Many women have done well (Proverbs 31:29): ..."She advises (taamah) that her merchandise is good; [her lamp never goes out at night]" - this is Channah who tasted (taamah) the taste of prayer, as it states (I Samuel 2:1), "And Hannah prayed, 'My heart exults in the Lord, etc.'" Therefore she merited and a son came from her that was the match of Moshe and Aharon, which would bring light to Israel like lamps, as it is written (Psalms 99:6), "Moshe and Aharon among his priests, and Shmuel among the ones that call His name." And it is written about Shmuel (I Samuel 3:3), "The lamp of God had not yet gone out, and Shmuel was sleeping in the temple of the Lord."
כי פקד ה' את חנה ותהר ותלד שלשה בנים ושתי בנות (שמואל א' ב' כ"א): ...דבר אחר כי פקד ה' את חנה זש"ה מצרף לכסף וכור לזהב ואיש לפי מהללו (משלי כ"ז כ"א) מהו מצרף לכסף וכור לזהב אלא כשם שהצורף הזה מכניס את הכסף לאש ואת הזהב לכור ואינו משהם בהם כך הקב"ה צורף את הצדיקים (מהם) כל אחד ואחד [מהם] לפי כבודו הוי מצרף לכסף וכור לזהב מהו ואיש לפי מהללו הקדוש ברוך הוא צורף את הצדיק לפי מעלליו וכן אתה מוצא שרה צירפה הקב"ה עשרים וחמש שנים משבאת לארץ ישראל כמה שכתב ואברהם בן חמש שנים ושבעים שנה בצאתו מחרן (בראשית י"ב ד') והיתה אותה שעה בת ששים וחמש שנים שהיה גדול הימנה עשר שנים והולידה בת תשעים שנה שהיה אברהם בן מאה שנה כשנולד יצחק שנאמר הלבן מאה שנה יולד ואם שרה הבת תשעים שנה תלד (שם י"ז י"ז) הרי נמצאת למד שצירפה הקדוש ברוך הוא לפי כחה ורבקה אף היא צירפה הקב"ה לפי כחה עשרים שנה מניין שכן כתב ויהי יצחק בן ארבעים שנה בקחתו את רבקה בת בתואל (שם כ"ה כ') וכתב ויצחק בן ששים שנה בלדת אותם (שם שם כ"ו) הרי נמצאת שצירף אותה הקדוש ברוך הוא עשרים שנה וחנה צירפה (אותה) הקדוש ברוך הוא אף [היא] לפי כחה וכמה צירף אותה אמרו רבותינו תשע עשרה שנה והיאך אלא עשר שנים ששהתה עמו ולא ילדה ונטל את פנינה וילדה לו עשרה בנים שכן אתה מוצא שאלקנה אומר לחנה הלא אנכי טוב לך מעשרה בנים (שמואל א' א' ח') אילו בניה של פנינה ואתה נותן שמונה שנים לעיבורים ושנה אחת לעיבורו של שמואל הרי תשע עשרה שנה ואח"כ פקדה כי פקד ה' [את] חנה:
The Bible does not specify how long Hannah was barren, a period that, according to the midrash, extended for nineteen years. Why was this righteous woman forced to suffer so many years of childlessness? In their answer to this question, the Rabbis cite Prov. 27:21: “For silver—the crucible, for gold—the furnace, and a man is tested by his praise.” The jeweler puts silver into the fire, and gold into the furnace, and fires every material in accordance with its strength. Thus, in this metaphor of the Rabbis, God refines in the crucible each of the righteous according to his or her strength: He refined Sarah for twenty-five years, Rebekah for twenty, and Hannah for nineteen. This midrash thus places Hannah together with the righteous Matriarchs, albeit with slightly less endurance than the latter. [Paraphrase from the Jewish Women's Archive.]
"'ha-Shem remembered Hannah" (1 Sh 2:21). Hannah was refined [in the crucible] by the K"BH according to her strength. How much did ha-Shem refine her? The Rabbis taught, nineteen years. How [do we know]? Ten years, she waited with him [Elkana], and didn't give birth. He took Penina, and she bore to him ten sons. Which you can derive, because Elkana said to Hannah, "Am I not better to you than ten sons?" (1 Sh 1:8). These were Penina's ten sons. You should allocate eight years for those pregnancies and one year for Shmuel's pregnancy. Behold, 19 years, after which she was remembered.
Avraham and then Ya'akov studied at the Yeshiva of Shem v'Aver. Hannah studied at the Yeshiva of hard knocks, for 19 long years, learning enough Torah and life-Torah to argue with God. Just look at the spectacular arguments she marshalls in the following midrashim.

Original text from Solomon Buber's edition, 1893, downloaded from HebrewBooks.org. Translations are my own.
Hannah said before the Holy One of Blessing: “Multiplier of Universes! Avraham did Your bidding, and You gave him a son when he was a hundred years old, while Ahav, who was an idolater, begot seventy sons! Sarah did Your bidding, and You gave her a son when she reached the age of ninety, while Izevel [Jezebel], a daughter of idolatrous priests, bore seventy sons!”
״וְחַנָּה הִיא מְדַבֶּרֶת עַל לִבָּהּ״. אָמַר רַבִּי אֶלְעָזָר מִשּׁוּם רַבִּי יוֹסֵי בֶּן זִמְרָא: עַל עִסְקֵי לִבָּהּ. אָמְרָה לְפָנָיו: רִבּוֹנוֹ שֶׁל עוֹלָם, כׇּל מַה שֶּׁבָּרָאתָ בָּאִשָּׁה, לֹא בָּרָאתָ דָּבָר אֶחָד לְבַטָּלָה: עֵינַיִם לִרְאוֹת, וְאׇזְנַיִם לִשְׁמוֹעַ, חוֹטֶם לְהָרִיחַ, פֶּה לְדַבֵּר, יָדַיִם לַעֲשׂוֹת בָּהֶם מְלָאכָה, רַגְלַיִם לְהַלֵּךְ בָּהֶן, דַּדִּים לְהָנִיק בָּהֶן. דַּדִּים הַלָּלוּ שֶׁנָּתַתָּ עַל לִבִּי לָמָּה? לֹא לְהָנִיק בָּהֶן?! תֵּן לִי בֵּן, וְאָנִיק בָּהֶן.
The Gemara continues to deal with Hannah’s prayer. It is said: “And Hannah spoke on her heart.” Several interpretations are offered to explain her use of the phrase “on her heart” instead of the common phrase to her heart (Maharsha). Rabbi Elazar said in the name of Rabbi Yosei ben Zimra: Hannah spoke to God concerning matters of her heart. She said before Him: Master of the Universe, of all the organs You created in a woman, You have not created one in vain. Every organ fulfills its purpose; eyes to see, ears to hear, a nose to smell, a mouth to speak, hands with which to perform labor, feet with which to walk, breasts with which to nurse. If so, these breasts that You placed upon my heart, to what purpose did You place them? Was it not in order to nurse with them? Grant me a son and I will nurse with them.


S. Buber comments: That is to say, if you're going to ask something from the Holy One of Blessing, don't ask for a little, but rather for a lot. Thus Hannah asked for a lot: "if you will look deeply upon me", "if you will remember me and not forget me", "give Your servant seed of men", the latter being explained below in Midrash Shmuel 2.7 as meaning, "descendents of wisdom and understanding."
ואם אין מתה אנכי. דאשה המבקשת בנים פעמים הוא משום דמבקשת התענוג דטבע האשה לגדל ולהשתעשע בבנים. ופעמים משום חוטרא לידה ומרא לקבורה. והתובעת בנים משום תענוג ראויה להתפייס במה שאישה מראה לה אהבה וחבה יתירה וכמאמר אלקנה לחנה למה תבכי הלא אנכי טוב לך מעשרה בנים והיינו דתנן שלהי מס׳ נדרים האומרת שמים ביני לבינך יעשה סעודה ויפייס.
אבל אם טוענת משום חוטרא לידה כו׳. אין עצה בפיוס וכדאי׳ בפ׳ הבע״י דמיד שמבקשת מזה הטעם יוציא ויתן כתובה. והיינו שקפצה חנה ונדרה ונתתה לאמתך זרע אנשים ונתתיו לה׳ כל ימי חייו שרגזה על החשד שחשדה אלקנה שמרעשת עולם בשביל תענוג. ואינו ראוי להיות כן. ע״כ נדרה שתתנהו למשכן ולא תשתעשע עמו כלל.
If not I am dead. When a women asks [ha-Shem] for children, sometimes they're asking for the sake of [future] joy, for it is the nature of women to raise and get enjoyment from their children. And sometimes it is for the sake of "a staff for her hand and a hoe for her burial" (Yev. 65b, i.e., economic support and life and especially old age). The one who seeks children for joy, it's appropriate to bargain with such a woman by offering alternative ways to increase her sources of love and endearment, as Elkanah did when responding to Hannah, "Why do you weep? I am not better to you than ten sons?" This is what the Mishnah (Nedarim 90b) is referring to, in the case when the woman says, "Heaven is between you and me" [while unknowable to certainty, she believes her husband's infertility is the reason they have had no children], then the proper course is to "make a feast and appease him" [i.e. persaude him to give her a divorce; see the commentary of the R"an, below].
But if her plea [for children] is because she needs [future] economic support, then appeasing her husband is not good advice. As it says in that chapter of Yevamot, if she is asking for a divorce for this reason, the husband should let her go out and should pay her ketubah. Thus when Hannah leapt up and swore her oath that "if You will grant Your maidservant male seed, I will dedicate him to ha-Shem for all the days of his life," it was because she was incited by the suspicion that Elkanah had cast upon her, that she was shaking the whole world for the sake of [her own personal] joy, which would not be fitting to do. Therefore she vowed to give him [Shmuel] to the Mishkan, and not to have any enjoyment with him [as a mother] at all.

R. Yehoshua ben Levi said: The Holy One of Blessing said to Hannah, since you have multiplied My champions [by being the first to use My name, ha-Shem Tzva'ot], I will multiply your champions. Thus the verse [I Divr Yam 25:5]...
(5) All these were sons of Heman [a descendent of Hannah], the seer [or prophet] of the king, with prophecies of God to lift up the horn [of salvation]. ha-Shem gave Heman fourteen sons and three daughters.
וגבי חנה דכתיב שם הרחמים גם בתחלה הי' הש"י עלי' ברחמים ולא הי' חסר אלא תפלה דלהוציא לעולם נפש יקרה כזו שפתח שער הנבואה אשר עד אז הי' דבר ד' יקר אין חזון נפרץ הי' צריך שיהי' אתדל"ת מקודם,
וע"כ הי' ב"ק מודיע מקודם שעתיד להוולד צדיק א' כדי שכ"א מישראל יתפלל וישתוקק שיהי' מחלציו, וזהו האתדל"ת בכלל ישראל,
ואצל חנה בפרט הי' הסיבה שנתעקרה מקודם וצרתה הרעימתה עד שהרעישה עולמות בתפלתה ונדרתו להש"י עד שעי"ז זכתה היא להוליד נפש הזה שהי' כבר מוכן לצאת אלא שהי' צריך אתדל"ת
For Hannah, mercy was also inscribed. Because initially, ha-Shem was inclined to be merciful, and the only thing missing was prayer, in order to bring forth into the world this precious soul [Shmuel] who would open the gate of prophecy. Until then, ha-Shem's word was so dear that prophetic vision did not propagate through the world. Arousal from below was needed as a prior condition.
Therefore a Bat Kol (a heavenly daughter's voice) announced beforehand, that in the future this tzaddik would be born [see the midrash from Yalkut Shimoni below]. Everyone in Yisrael davenned, yearning that it be from their birth-labor. This constituted the arousal from below from all of Yisrael.
Then it was Hannah in particular, who was already suffering from her barrenness, with her anguish and vexation, until she rocked the worlds with her prayer, swearing her oath to ha-Shem. It was by this means she merited to give birth to this soul, which had already been prepared to come out, needing only the arousal from below.
"May ha-Shem fulfill ha-Shem's word" (I Shmuel 1:23).
R. Yirmiyah in the name of R. Shmuel b' R. Yitzhak: Every single day, a Bat Kol (a heavenly daughter's voice) shattered throughout the entire world, saying "A single tzadik will arise and his name will be Shmuel." So every woman that birthed a son named him Shmuel. But when they saw his deeds, they would say, "That's not Shmuel." Therefore when this one [Shmuel] was born and they saw his deeds, they said, this is the one we imagined.
ולפי האמור יובן הא דחנה, דהנה עלי ידע דחנה לאו תפילה הסדורה התפללה אז, כי היתה אחר אכילה ושתי' כמפורש בכתוב שאין זה זמן תפילה, ועוד כי הרבתה להתפלל משמע יותר מכשיעור תפילה הסדורה כמפורש בכתוב,
אלא תפילה פרטית לפי מצוקת לבה, וע"כ הי' בדין להתפלל בקול וכמ"ש הזוה"ק הנ"ל צלותא דארים בר נש קלי' בעקתי' ע"כ בהיותה מתפללת בלחש חשבה לשיכורה, אך כתיב וחנה היא מדברת על לבה משמע שהמוח דיבר על הלב, וא"כ מקור מוצא תפילתה הי' מהמוח מצד התבוננות השכל,
וברש"י שם ה' צבאו' למה נתיחד שם זה כאן אמרה לפניו רבש"ע שני צבאות בראת בעולמך העליונים לא פרים ורבים ולא מתים והתחתונים פרים ורבים ומתים אם אני מהתחתונים אהי' פרה ורבה ומתה ואם אני מהעליונים לא אמות,
ובש"ס ברכות (ל"א:) וחנה היא מדברת על לבה אמ"ר אלעזר בשם ר"י בר' זימרא על עסקי לבה אמרה לפניו רבש"ע כל מה שבראת באשה לא בראת דבר אחד לבטלה וכו' עיי"ש, הרי שתפילתה היתה מהתבוננות המוח והשכל, וכן כתיב ותתפלל על ה' והבן, ע"כ היתה תפילתה בלחש:
According to the teaching you should understand about Hannah. Because here is what you should come to know, that Hannah did not follow the established order of prayer that she would have prayed then. For it was after eating and drinking, and the interpretation of the law is that that is no time for prayer. Furthermore, she extended her prayer far beyond the measure of the order of the prayer according to the interpretation of the law.
Rather, it was a personal prayer according to the distress of her heart. In which case, the law is that she should have davened out loud. As the Holy Zohar writes, "a prayer cried out loud. A man raises his voice and cries to Hashem in his trouble" (1:132a). Therefore, when she was davenning silently, it was thought she was drunk. Thus it is written, "Hannah was praying in her heart" (I Shmuel 1:13), it means that the intellect of speech was upon her heart [i.e. internal dialogue]. If so, the source for what came out as her prayer, was intellectual, from the side of considered understanding.
[An example of Hannah's impassioned yet reasoned dialogue with ha-Shem:] Rashi's commentary on the name "God of Hosts" (verse 1:11) asks, "Why was this Name designated here? She [Hannah] said before ha-Shem, "Multiplier of Universes, You created two hosts in Your world. The heavenly beings neither multiply nor do they die; the earthly beings both multiply and die. If I am of the earthly beings, let me multiply and die, and if I am of the heavenly beings, let me not die."
And in the Gemara (b. Brachot 31b): “And Hannah spoke on her heart.” [Why "on", not "to"?] Rabbi Elazar said in the name of Rabbi Yosei ben Zimra: concerning matters of her heart. She said before Ha-Shem: "Multiplier of Universes, of all the organs You created in a woman, You have not created one in vain, etc." Behold, that her prayer was from understanding, intellectual and considered thought [i.e. reasoned argument]. That's why the verse (10) says that "she prayed in opposition to ha-Shem." With this understood, therefore her prayer was silent.
״אִם רָאֹה תִרְאֶה״, אָמַר רַבִּי אֶלְעָזָר: אָמְרָה חַנָּה לִפְנֵי הַקָּדוֹשׁ בָּרוּךְ הוּא: רִבּוֹנוֹ שֶׁל עוֹלָם, ״אִם רָאֹה״ — מוּטָב, וְאִם לָאו — ״תִּרְאֶה״. אֵלֵךְ וְאֶסְתַּתֵּר בִּפְנֵי אֶלְקָנָה בַּעֲלִי, וְכֵיוָן דְּמִסְתַּתַּרְנָא מַשְׁקוּ לִי מֵי סוֹטָה, וְאִי אַתָּה עוֹשֶׂה תּוֹרָתְךָ פְּלַסְתֵּר, שֶׁנֶּאֱמַר ״וְנִקְּתָה וְנִזְרְעָה זָרַע״.
(sources and texts referenced in the conclusion are below)
Hannah was willing to threaten ha-Shem with subverting the Torah itself! As the Shem Mi-Shmuel tells us, she out-logiced God! What could ha-Shem do, but laugh, and declare, "נצחוני בנותי, נצחוני בנותי".
[All the more so, because as the fourth of the seven prophetesses, Hannah is associated with the fourth sefirah, netzach, i.e. triumph.]
As the Emek HaDavar teaches us, it wasn't to alleviate her own suffering, as acute as it was. And it wasn't just to save Bnei Korach. Rather, as the Tzadok haCohen understood, it was because she saw how much the world needed to hear Ruach ha-Kodesh, to open up the gates of Nevuah.
I.e., her mahkloket with ha-Shem was surely לְשֵׁם שָׁמַיִם. In the language of the Ishbitzer Rebbe, she had gone through a long process of berur, and was firm that her motivation wasn't ego or base desire, but fully ratzon ha-Shem.
With this understanding, Hannah reminds us of עֵ֭ת לַעֲשׂ֣וֹת לַיהֹוָ֑ה. That in a specific time and place when it's needed, we are obligated to stand up, to shout (even silently, even if we're thought to be a drunkard or a wild-eyed optimist), to argue with ha-Shem and anyone else who will listen, to become an Eshet Chutzpah.
(יז) כָּל מַחֲלֹקֶת שֶׁהִיא לְשֵׁם שָׁמַיִם, סוֹפָהּ לְהִתְקַיֵּם. וְשֶׁאֵינָהּ לְשֵׁם שָׁמַיִם, אֵין סוֹפָהּ לְהִתְקַיֵּם. אֵיזוֹ הִיא מַחֲלֹקֶת שֶׁהִיא לְשֵׁם שָׁמַיִם, זוֹ מַחֲלֹקֶת הִלֵּל וְשַׁמַּאי. וְשֶׁאֵינָהּ לְשֵׁם שָׁמַיִם, זוֹ מַחֲלֹקֶת קֹרַח וְכָל עֲדָתוֹ:
(17) Every dispute that is for the sake of Heaven, will in the end endure; But one that is not for the sake of Heaven, will not endure. Which is the controversy that is for the sake of Heaven? Such was the controversy of Hillel and Shammai. And which is the controversy that is not for the sake of Heaven? Such was the controversy of Korah and all his congregation.
With this picture of Korach's descendent Hannah, perhaps we could understand Korach's shortcoming as having taken up his argument with Moshe, rather than arguing directly with ha-Shem. [b'shem omro: David Waskow]
אשכחיה רבי נתן לאליהו א"ל מאי עביד קוב"ה בההיא שעתא א"ל קא חייך ואמר נצחוני בני נצחוני בני
Years after, Rabbi Natan encountered Eliyahu the prophet and said to him: What did the Holy One of Blessing do at that time, when Rabbi Yehoshua issued his declaration? Eliyahu said to him: The Holy One of Blessing laughed and said: My children have triumphed over Me; My children have triumphed over Me.
(קכו) עֵ֭ת לַעֲשׂ֣וֹת לַיהֹוָ֑ה הֵ֝פֵ֗רוּ תּוֹרָתֶֽךָ׃
(126) It is a time to act for ha-Shem, for they have violated Your teaching [or, even by violating Your Torah].
“Elohim, You have taught me from my youth, and even today I will tell of Your wonders. Even in my old age and gray hair, Elohim, do not abandon me ….” (Tehilim, 71:17–18)
A person needs to examine and understand themselves from their youth, before their inclinations forcefully overwhelm them. They need to understand to which pleasures one is strongly attached, and which are far from their heart. From this knowledge, they will have the insight to know what ha-Shem has prepared for them, to test them, so that they can clarify for themselves [yebarer] what they have to overcome and [which mitzvah] to observe. For ha-Shem has apportioned to each person a unique mitzvah with which to clarify themselves. The person must achieve certainty with regard to the mitzvah relevant to them. [Translation adapted from R. Moshe Faierstein, All is in the Hands of Heaven, p. 45]