"And the children struggled within her" they were contending over this world and the world to come. At that moment Samael wished to kill Jacob in his mother's belly, but Michael stood against him. At that hour Michael rose and wished to burn Samael, until the Holy One, blessed be He, seated courts of judgment between them. "And the LORD said to her" through Shem son of Noah (as it is written in the verse, "and Sarah denied").
Michael and Samael Contend Over Jacob in the Womb
Yalkut Shimoni on Torah 110:19
וַיִּתְרֹצֲצוּ הַבָּנִים בְּקִרְבָּהּ, שֶׁהָיוּ חוֹלְקִין בִּשְׁבִיל הָעוֹלָם הַזֶה וְהָעוֹלָם הַבָּא, בְּאוֹתָה שָׁעָה רָצָה סַמָאֵל לַהֲרוֹג יַעֲקֹב בִּמְעֵי אִמּוֹ, אֶלָּא שֶׁעָמַד מִיכָאֵל כְּנֶגְדּוֹ. בְּאוֹתָהּ שָׁעָה עָמַד מִיכָאֵל וְרָצָה לִשְׂרוֹף לְסַמָאֵל, עַד שֶׁהּוֹשִׁיב הַקָּדוֹשׁ בָּרוּךְ הוּא בָּתֵּי דִּינִים בֵּינֵיהֶן. וַיֹּאמֶר ה' לָהּ, עַל יְדֵי שֵׁם בֶּן נֹחַ (כַּכָּתוּב בַּפָּסוּק וַתְּכַחֵשׁ שָׂרָה).