18:1

וַיֵּרָא אֵלָיו יְהוָה בְּאֵלֹנֵי מַמְרֵא וְהוּא יֹשֵׁב פֶּתַח־הָאֹהֶל כְּחֹם הַיּוֹם׃

And the Eternal appeared to him by the oaks of Mamre, as he sat at the entrance of the tent in the heat of the day.

Bereshit 18:1

וַיֵּרָא אֵלָיו יְהוָה

Bereshit / Genesis 18:1 · Drash

Bereshit 18:1

וַיֵּרָא אֵלָיו יְהוָה בְּאֵלֹנֵי מַמְרֵא וְהוּא יֹשֵׁב פֶּתַח־הָאֹהֶל כְּחֹם הַיּוֹם׃

And the Eternal appeared to him by the oaks of Mamre, as he sat at the entrance of the tent in the heat of the day.

Drash דְּרָשׁ

The teacher came before the students

First "the Eternal appeared to him", and only then Avraham sees three angels. The midrash asks why in that order. And why did He appear just "by the oaks of Mamre"?

Tanchuma: usually, when a student is sick, other students come first to announce that the teacher is coming. But the Eternal sent angels to visit Avraham and came Himself before them. There is no humility greater than this. Lekach Tov: Avraham asked his three allies for advice about circumcision. Aner and Eshkol talked him out of it, but Mamre said: He saved you from the fiery furnace, do it quickly. So the Eternal appeared to Avraham in Mamre's territory.

How Midrash Tanchuma and Midrash Lekach Tov explain it

Midrash Tanchuma

As is the way of the world: when a student is sick and the teacher goes to visit him, the students go first and say in the sick man's house that the teacher wishes to visit him. But the Holy One, blessed is He, is not so. When Avraham was circumcised and suffering from it, He told the angels to go and visit him. While the angels were on their way, the Holy One, blessed is He, came before them, as it says: "and the Eternal appeared to him", and afterwards: "and he lifted up his eyes and saw" (18:2). Is there humility greater than this?

Midrash Lekach Tov By the oaks of Mamre

Mamre was bold with Avraham. When the Holy One, blessed is He, said to Avraham "and you shall keep My covenant" (17:9), he took counsel with his three allies, as it is written: "Aner, Eshkol and Mamre, and they were Avram's allies" (14:13). Aner said to him: you are already old, a hundred years old, and you want to cause yourself pain? Eshkol said to him: why go and make yourself hateful among your enemies? Mamre said to him: if so, did your Almighty not stand by you in the fiery furnace? In the famine? Against the kings? What He has told you, do quickly, do not delay. The Holy One, blessed is He, said: you advised him to be circumcised. By your life, I will appear to him only in your palace. This is what it says: "and the Eternal appeared to him by the oaks of Mamre".

Takeaway

"The fiery furnace" is the midrash's story of Nimrod throwing Avram into the fire in Ur Kasdim, and the Eternal saving him (Bereshit Rabbah 38:13).
"The famine" and "the kings" are events of earlier chapters: the famine that took Avram to Egypt (12:10), and the war of the four kings (chapter 14).
Tanchuma draws the order from two verses in a row: 18:1 speaks of the Eternal, 18:2 of the three travellers.