"And he had two wives" (1 Samuel 1:2). Rabbi Ammi in the name of Rabbi Isaac: the verse opens with his praise and closes with his praise. Rabbi Levi in the name of Rabbi Chama bar Chanina: the verse opens with his praise and mentions his disgrace. Rabbi Jonah in the name of Rabbi Chama said: when Hannah saw that she had not given birth, she said, "I will tell him to bring my rival-wife into my house, and through this perhaps the Holy One, blessed be He, will see and remember me." The Holy One, blessed be He, said to her: "Hannah, you have deposited souls with Me; by your life, I will repay you," as it is written, "For the LORD remembered Hannah, and she conceived and bore" (1 Samuel 2:21) three sons and two daughters.
Hannah Entrusts Her Future Children to Heaven
Yalkut Shimoni on Nach 77:3
ולו שתי נשים. ר' אמי בש"ר יצחק הכתוב פותח בשבחו וחותם בשבחו. ר' לוי בש"ר חמא בר חנינא הכתוב פותח בשבחו ומזכיר גנותו. א"ר יונה בש"ר חמא כיון שראתה חנה שלא ילדה אמרה אומר לו שיכניס צרתי בתוך ביתי ומתוך כך יראה הקב"ה ויפקוד אותוי. אמר לה הקב"ה חנה הפקדת אצלי נפשות חייך אני משלם לך כי פקד ה' את חנה ותהר ולתלד שלשה בנים ושתי בנות: