26:18

וַיָּשָׁב יִצְחָק וַיַּחְפֹּר אֶת־בְּאֵרֹת הַמַּיִם אֲשֶׁר חָפְרוּ בִּימֵי אַבְרָהָם אָבִיו וַיְסַתְּמוּם פְּלִשְׁתִּים אַחֲרֵי מוֹת אַבְרָהָם וַיִּקְרָא לָהֶן שֵׁמוֹת כַּשֵּׁמֹת אֲשֶׁר־קָרָא לָהֶן אָבִיו׃

And Yitzchak dug again the wells of water that had been dug in the days of Avraham his father, which the Philistines had stopped up after Avraham's death. And he gave them the same names his father had given them.

Bereshit 26:18

וַיָּשָׁב יִצְחָק וַיַּחְפֹּר

Bereshit / Genesis 26:18 · Drash

Bereshit 26:18

וַיָּשָׁב יִצְחָק וַיַּחְפֹּר אֶת־בְּאֵרֹת הַמַּיִם אֲשֶׁר חָפְרוּ בִּימֵי אַבְרָהָם אָבִיו וַיְסַתְּמוּם פְּלִשְׁתִּים אַחֲרֵי מוֹת אַבְרָהָם וַיִּקְרָא לָהֶן שֵׁמוֹת כַּשֵּׁמֹת אֲשֶׁר־קָרָא לָהֶן אָבִיו׃

And Yitzchak dug again the wells of water that had been dug in the days of Avraham his father, which the Philistines had stopped up after Avraham's death. And he gave them the same names his father had given them.

Drash דְּרָשׁ

Five wells, five books

A spring you dig out can be more than water. The midrash counts Yitzchak's wells and finds in them the five books of the Torah, from the creation of the world to Moshe's last words.

Bereshit Rabbah asks how many wells Yitzchak (Isaac) dug. Rabbi Yehuda says: four, against the four camps in which his descendants marched through the wilderness. The sages say: five, against the five books of the Torah. Esek, "contention" (עֵשֶׂק), is Bereshit, where the Holy One, blessed is He, was occupied (נִתְעַסֵּק) with creating the world. Sitnah, "enmity", is Shemot, with its bitter labour in Egypt. The well of living water is Vayikra, full of laws, Shivah is Bamidbar, and Rechovot, "wide spaces", is Devarim.

How Bereshit Rabbah explain it

Bereshit Rabbah And Yitzchak dug again and so on

How many wells did our father Yitzchak dig in Be'er Sheva? Rabbi Yehuda said: four, and against them his sons became four camps in the wilderness. And the sages say: five, against the five books of the Torah.
"And he called the well Esek": against the book of Bereshit, in which the Holy One, blessed is He, was occupied and created the world. "And he called it Sitnah": against the book "Ve'eleh Shemot", after the verse "and they made their lives bitter with hard labour" (Shemot / Exodus 1:14). "And they found there a well of living water": against the book of Vayikra, which is full of many laws. "And he called it Shivah": against the book "Vayedaber", which completes the seven books of the Torah.
But are they not five? But Bar Kappara makes the book "Vayedaber" into three books: from "and He spoke" to "and it was, when the ark set out" is a book by itself, "and it was, when the ark set out" and what follows it is a book by itself, and from the end of that passage to the end of the book is a book by itself.
"And he called it Rechovot": against the book Mishneh Torah, after the words "for He will widen", "for now the Eternal has made room for us, and we will be fruitful in the land".

Takeaway

Esek (עֵשֶׂק) and "was occupied" (נִתְעַסֵּק): the words share their sounds, though they are written with different letters, sin (שׂ) and samech (ס). The midrash links the well's name with the Creator occupied with creating the world.
The midrash names the books of the Torah by their first words: "Ve'eleh Shemot" (Shemot / Exodus), "Vayedaber" (Bamidbar / Numbers), "Mishneh Torah", that is, "the repetition of the Torah" (Devarim / Deuteronomy).
The passage "and it was, when the ark set out" (Bamidbar / Numbers 10:35–36) is set apart in the scroll by inverted letters nun (נ). The Talmud brings the view that it is a book of its own, so that the books of the Torah are seven (Shabbat 116a).
Four camps: on the way through the wilderness the twelve tribes marched in four groups of three, each under its own banner (Bamidbar / Numbers 2).
Yitzchak's wells in the verses: Esek and Sitnah (26:20–21), Rechovot (26:22), the well of living water (26:19), Shivah (26:33).