Another interpretation of "and the children struggled": when she passed by houses of idol worship, Esau would thrash to come out, "the wicked are estranged from the womb, going astray from birth" (Psalms 58:4 [58:3]); when she passed by synagogues and houses of study, Jacob would thrash to come out, as it is written, "Before I formed you in the belly I knew you" (Jeremiah 1:5). "And she said, If it be so, why am I thus?" (Genesis 25:22) teaches that Rebecca our mother went around to the doors of the women, saying: did this anguish ever come upon you? If this is the anguish of children, would that I had not conceived. "If so, I am destined to raise up twelve tribes; would that I had not conceived" for Rebecca was fit to raise up twelve tribes. This is what is written: "And the LORD said to her, Two nations are in your womb" (Genesis 25:23) that is two; "and two peoples shall be separated from your bowels," that is four; "and one people shall be stronger than the other people," that is six; "and the elder shall serve the younger," that is eight; "and her days were fulfilled to be delivered, and behold, there were twins in her womb," that is ten; "and the first came out ruddy," that is eleven; "and after that came his brother," that is twelve. And there are those who derive it from this verse: "this" (zeh) in numerical value equals twelve. "And she went to inquire of the LORD" (Genesis 25:22) and were there synagogues and houses of study in those days? Rather, she went only to the house of study of Shem and Eber, to teach you that whoever receives the face of an elder is as though he receives the face of the Divine Presence.
Esau Stirs at Idols and Jacob at the House of Study
Yalkut Shimoni on Torah 110:18
דָּבָר אַחֵר וַיִּתְרֹצֲצוּ הַבָּנִים עוֹבֶרֶת עַל בָּתֵּי עֲבוֹדָה זָרָה עֵשָׂו מְפַרְכֵס לָצֵאת "זֹרוּ רְשָׁעִים מֵרָחֶם תָּעוּ מִבֶּטֶן". עוֹבֶרֶת עַל בָּתֵּי כְּנֵסִיּוֹת וּבָתֵּי מִדְרָשׁוֹת יַעֲקֹב מְפַרְכֵס לָצֵאת, הֲדָא הוּא דִכְתִיב (ירמיה א, ה) "בְּטֶרֶם אֶצָרְךָ בַּבֶּטֶן יְדַעְתִּיךָ". וַתֹּאמֶר אִם כֵּן לָמָּה זֶּה אָנֹכִי, מְלַמֵּד שֶׁהָיְתָה רִבְקָה אִמֵּנוּ מְחַזֶּרֶת עַל פִּתְחֵיהֶן שֶׁל נָשִׁים, וְאוֹמֶרֶת הִגִּיעַ לָכֶם הַצַּעַר הַזֶּה מִימֵיכֶם אִם כֵּן הוּא הַצַּעַר שֶׁל בָּנִים הַלְוַאי לֹא עִיבַּרְתִּי. אִם כֵּן אֲנִי עֲתִידָה לְהַעֲמִיד שְׁנֵים עָשָׂר שְׁבָטִים הַלְוַאי לֹא עִיבַּרְתִּי שֶׁרְאוּיָה הָיְתָה רִבְקָה לְהַעֲמִיד שְׁנֵים עָשָׂר שְׁבָטִים, הֲדָא הוּא דִכְתִיב וַיֹּאמֶר ה' לָהּ שְׁנֵי גּוֹיִם בְּבִטְנֵךְ, הָא תְּרֵין. וּשְׁנֵי לְאֻמִּים מִמֵּעַיִךְ יִפָּרֵדוּ, הָא אַרְבַּע. וּלְאֹם מִלְאֹם יֶאֱמָץ, הָא שִׁיתָא. וְרַב יַעֲבֹד צָעִיר, הָא תְּמַנְיָא. וַיִּמְלְאוּ יָמֶיהָ לָלֶדֶת וְהִנֵּה תוֹמִים בְּבִטְנָהּ, הָא עֲשָׂרָה. וַיֵּצֵא הָרִאשׁוֹן אַדְמוֹנִי, הָא חַד עָשָׂר. וְאַחֲרֵי כֵן יָצָא אָחִיו הָא תְּרֵיסָר. וְאִית דְּמַּיתֵי לָהּ מִן הֲדֵּין קַרְיָא, "ז"ה" בְּגִימַטְרִיָא תְּרֵיסַר. וַתֵּלֶךְ לִדְרֹשׁ אֶת ה', וְכִי בָּתֵּי כְּנֵסִיּוֹת וּבָתֵּי מִדְרָשׁוֹת הָיוּ בְּאוֹתָן הַיָּמִים, אֶלָּא לֹא הָלְכָה אֶלָּא לְבֵית מִדְרָשׁוֹ שֶׁל שֵׁם וְעֵבֶר, לְלַמֶּדְךָ כָּל מִי שֶׁהוּא מְקַבֵּל פְּנֵי זָקֵן כְּאִלּוּ הוּא מְקַבֵּל פְּנֵי שְׁכִינָה.