"And he looked, and behold, a ram afterward [achar]." What is "afterward"? After all the deeds, Israel becomes entangled in transgressions and ensnared in troubles, and in the end they will be redeemed by the horns of the ram, as it is written, "On that day a great shofar shall be sounded" (Isaiah 27:13). Because Abraham our father saw the ram tearing loose from one thicket and becoming entangled in another, the Holy One, blessed be He, said to him: "So are your children destined to be entangled among the kingdoms, from Babylon to Media, and from Media to Greece, and from Greece to Edom, and in the end they will be redeemed by the horns of the ram," as it is written, "And the LORD God will sound the shofar... the LORD... will shield them" (Zechariah 9:14-15). "And Abraham went and took the ram and offered it up as a burnt-offering in place of his son." He said before Him: "Master of the universe, regard the blood of this ram as though it were the blood of Isaac my son being brought near." This is like what we have learned: "Behold, this in place of this; behold, this is the exchange of this; behold, this is the substitute." Rabbi Pinchas said: he said before Him: "Master of the universe, regard the blood of this ram as though I had first offered Isaac my son, and afterward offered the ram in his place," as it is said, "And Jotham his son reigned in his place" (2 Kings 15:7), meaning in his stead. "And Abraham called the name of that place, The LORD will see" (Genesis 22:14). He said before Him: "Master of the universe, when You said to me, 'Take now your son,' I had reason to answer: yesterday You said to me, 'For in Isaac shall your seed be called,' and now You say, 'Take now your son.' Yet I did not do so, but suppressed my mercy to do Your will. May it be Your will that when the children of Isaac come into transgressions, You will remember for them this binding-service and be filled with mercy upon them."
Israel Tangled in the Kingdoms and Freed by the Ram's Horn
Yalkut Shimoni on Torah 101:7
וַיַּרְא וְהִנֵּה אַיִל אַחַר מַהוּ אַחַר, אַחַר כָּל הַמַּעֲשִׂים יִשְׂרָאֵל נֶאֱחָזִים בַּעֲבֵירוֹת, וּמִסְתַּבְּכִים בְּצָרוֹת וְסוֹפָן לִיגָאֵל בְּקַרְנָיו שֶׁל אַיִל, הַדָא הוּא דִּכְתִיב, "בַּיּוֹם הַהוּא יִתָּקַע בְּשׁוֹפָר גָּדוֹל". לְפִי שֶׁהָיָה אַבְרָהָם אָבִינוּ רוֹאֶה אֶת הָאַיִל נוֹתֵשׁ מֵחוֹרֵשׁ זֶה, וְנִסְבַּךְ בְּחוֹרֵשׁ אַחֵר אָמַר לוֹ הַקָּדוֹשׁ בָּרוּךְ הוּא, כָּךְ עֲתִידִין בָּנֶיךָ לְהִסְתַּבֵּךְ בְּמַלְכֻיּוֹת מִבָּבֶל לְמָדַּי, וּמִמָּדַּי לְיָוָן, וּמִיָּוָן לֶאֱדוֹם, וְסוֹפָן לְהִגָּאֵל בְּקַרְנָיו שֶׁל אַיִל, הַדָא הוּא דִּכְתִיב, (זכריה ט, יד טו) "וַה' אֱלֹהִים בַּשּׁוֹפָר יִתְקָע... ה'... יָגֵן עֲלֵיהֶם". וַיֵּלֵךְ אַבְרָהָם וַיִּקַּח אֶת הָאַיִל וַיַּעֲלֵהוּ לְעֹלָה תַּחַת בְּנוֹ. אָמַר לְפָנָיו, רִבּוֹנוֹ שֶׁל עוֹלָם, הֱוֵי רוֹאֶה דָּמוֹ שֶׁל אַיִל זֶה, כְּאִלּוּ דָּמוֹ שֶׁל יִצְחָק בְּנִי קָרֵב. כְּהַדָא דְתָנִינָא הֲרֵי זוֹ תַּחַת זוֹ הֲרֵי זוֹ חִלּוּפֵי זוֹ הֲרֵי זוֹ תְּמוּרָה. רַבִּי פִּנְחָס אָמַר, [אָמַר] לְפָנָיו, רִבּוֹנוֹ שֶׁל עוֹלָם, הֱוֵי רוֹאֶה דָּמוֹ שֶׁל אַיִל זֶה כְּאִלּוּ הִקְרַבְתִּי אֶת יִצְחָק בְּנִי תְּחִלָּה, וְאַחַר כָּךְ הִקְרַבְתִּי אֶת הָאַיִל תַּחְתָּיו, כִּדְאָמַר (מלכים ב טו, יז) "וַיִּמְלוֹךְ יֹתָם בְּנוֹ תַּחְתָּיו", בִּמְקוֹמוֹ, כְּהַדָא דִּתְנַן הֲרֵי עָלַי כְּאִימְרָא כְּדִירִים [רַבִּי יוֹחָנָן] אָמַר, כְּאִימְרָא תְּמִידָא [רֵישׁ לָקִישׁ] אָמַר, כְּאֵילוֹ שֶׁל יִצְחָק, תַּמָן אַמְרֵי כִּוְלַד הַחֲטָּאת תָּנִי בַּר קַפָּרָא כְּאִימָר דְלֹא יָנַק מִן יוֹמוֹי. (בראשית כב יד) וַיִּקְרָא אַבְרָהָם שֵׁם הַמָּקוֹם הַהוּא ה' יִרְאֶה. אָמַר לְפָנָיו, רִבּוֹנוֹ שֶׁל עוֹלָם, בְּשָׁעָה שֶׁאָמַרְתָּ לִי (לעיל פסוק ב) קַח נָא אֶת בִּנְךָ, הָיָה לִי לְהָשִׁיב אֶתְמוֹל אָמַרְתָּ לִי "כִּי בְיִצְחָק יִקָּרֵא לְךָ זָרַע" וְעַכְשָׁיו אַתָּה אָמַרְתָּ לִי קַח נָא אֶת בִּנְךָ, וְלֹא עָשִׂיתִי כֵּן, אֶלָּא כָּבַשְׁתִּי רַחֲמָי לַעֲשׂוֹת רְצוֹנְךָ. יְהִי רָצוֹן מִלְּפָנֶיךָ בְּשָׁעָה שֶׁיְּהוּ בָּנָיו שֶׁל יִצְחָק בָּאִין לִידֵי עֲבֵירוֹת, תִּהְיֶה נִזְכָּר לָהֶם הָעֲבוֹדָה הַזֹּאת וְתִתְמַלֵּא עֲלֵיהֶם רַחֲמִים.