The story of the battle of the four kings against the five in Bereshit 14 seems out of place in the larger cycle of Avraham narratives. It deals mainly with conquest and foreign armies rather than Avraham's immediate family or his relationship with Hashem. Nothing in the episode seems crucial for understanding any of the preceding or following stories. What, then, is the purpose of including the episode? What messages is it meant to share?
The narrative opens with a series of verses which seem totally unnecessary even for the immediate story itself:
(ה) וּבְאַרְבַּע עֶשְׂרֵה שָׁנָה בָּא כְדָרְלָעֹמֶר וְהַמְּלָכִים אֲשֶׁר אִתּוֹ וַיַּכּוּ אֶת רְפָאִים בְּעַשְׁתְּרֹת קַרְנַיִם וְאֶת הַזּוּזִים בְּהָם וְאֵת הָאֵימִים בְּשָׁוֵה קִרְיָתָיִם. (ו) וְאֶת הַחֹרִי בְּהַרְרָם שֵׂעִיר עַד אֵיל פָּארָן אֲשֶׁר עַל הַמִּדְבָּר. (ז) וַיָּשֻׁבוּ וַיָּבֹאוּ אֶל עֵין מִשְׁפָּט הִוא קָדֵשׁ וַיַּכּוּ אֶת כָּל שְׂדֵה הָעֲמָלֵקִי וְגַם אֶת הָאֱמֹרִי הַיֹּשֵׁב בְּחַצְצֹן תָּמָר.
(5) And in the fourteenth year, Kedorlaomer and the kings with him came and struck Refaim in Ashterot Karnayim and the Zuzim in Ham and the Eimim in Shaveh Kiryatayim. (6) And the Chorites in their Mount Seir as far as Eil Paran which is by the wilderness. (7) And they returned and came to Ein Mishpat, which is Kadesh, and they struck the entire Amalekite field and also the Amorites dwelling in Chatzetzon Tamar.
Why does the chapter go out of its way to list all the nations who were previously conquered by the four kings if they play no subsequent role in the story?
Bereshit 14 and Devarim 2
Interestingly, these very same names appear again in Devarim 2 where they seem to be just as obtrusive and irrelevant:
(ט) וַיֹּאמֶר י״י אֵלַי אַל תָּצַר אֶת מוֹאָב וְאַל תִּתְגָּר בָּם מִלְחָמָה כִּי לֹא אֶתֵּן לְךָ מֵאַרְצוֹ יְרֻשָּׁה כִּי לִבְנֵי לוֹט נָתַתִּי אֶת עָר יְרֻשָּׁה. (י) הָאֵמִים לְפָנִים יָשְׁבוּ בָהּ עַם גָּדוֹל וְרַב וָרָם כָּעֲנָקִים. (יא) רְפָאִים יֵחָשְׁבוּ אַף הֵם כָּעֲנָקִים וְהַמֹּאָבִים יִקְרְאוּ לָהֶם אֵמִים. (יב) וּבְשֵׂעִיר יָשְׁבוּ הַחֹרִים לְפָנִים וּבְנֵי עֵשָׂו יִירָשׁוּם וַיַּשְׁמִידוּם מִפְּנֵיהֶם וַיֵּשְׁבוּ תַּחְתָּם כַּאֲשֶׁר עָשָׂה יִשְׂרָאֵל לְאֶרֶץ יְרֻשָּׁתוֹ אֲשֶׁר נָתַן י״י לָהֶם...
(יט) וְקָרַבְתָּ מוּל בְּנֵי עַמּוֹן אַל תְּצֻרֵם וְאַל תִּתְגָּר בָּם כִּי לֹא אֶתֵּן מֵאֶרֶץ בְּנֵי עַמּוֹן לְךָ יְרֻשָּׁה כִּי לִבְנֵי לוֹט נְתַתִּיהָ יְרֻשָּׁה. (כ) אֶרֶץ רְפָאִים תֵּחָשֵׁב אַף הִוא רְפָאִים יָשְׁבוּ בָהּ לְפָנִים וְהָעַמֹּנִים יִקְרְאוּ לָהֶם זַמְזֻמִּים.
(9) Hashem said to me, “Don’t bother Moab, neither contend with them in battle; for I will not give you of his land for a possession; because I have given Ar to the children of Lot for a possession.” (10) The Emim lived therein before, a people great, and many, and tall, as the Anakim: (11) these also are accounted Rephaim, as the Anakim; but the Moabites call them Emim. (12) The Horites also lived in Seir before, but the children of Esau succeeded them; and they destroyed them from before them, and lived in their place; as Israel did to the land of his possession, which Hashem gave to them....
(19) and when you come near over against the children of Ammon, don’t bother them, nor contend with them; for I will not give you of the land of the children of Ammon for a possession; because I have given it to the children of Lot for a possession.” (20) That also is accounted a land of Rephaim: Rephaim lived therein before; but the Ammonites call them Zamzummim,
Is there a connection between the chapters in Bereshit and Devarim which might help explain the need for all of these details?