Torah Engraved Through Trust
אמו"ז ז"ל אמר פי' במחוקק במשענותם
My maternal grandfather and teacher, of blessed memory, gave an explanation of the verse "with the lawgiver, with their staffs" (Bamidbar 21:18).
The Sfas Emes cites a teaching from his grandfather explaining the phrase from the Torah's song about the well, where "lawgiver" (mechokek) hints at the engraving (chakikah) of Torah and "their staffs" at what supports and sustains a person.
כי לפי הבטחון שבנ"י בוטחין בתורה כך עושה חקיקה בלבבם כמ"ש במד' ע"פ עץ חיים היא למחזיקים משל הנטבע בנהר ונותנים לו חבל ואומרים לו הזהר לאחוז בו כי חייך תלוין בו ע"ש במד' שלח
For according to the measure of bitachon (trust) with which Bnei Yisrael place their trust in the Torah, so does it engrave an engraving upon their hearts, as the Midrash states on the verse "It is a tree of life to those who grasp it" (Mishlei 3:18): a parable of one who is drowning in a river, and they extend him a rope and say to him, "Take care to grip it tightly, for your life depends upon it" - see there in the Midrash on parashas Shelach.
The depth to which Torah is engraved in a person's heart corresponds to how strongly he trusts and clings to it; the Midrash compares this to a drowning man told to grip the rescue rope tightly because his very life hangs upon it.
והיינו כפי מה שמחזיקים בו כך נותן החיים עכ"ד ז"ל
And this is to say: according to the measure in which a person grasps hold of the Torah, so does it grant him life - thus far the words of my grandfather and teacher, of blessed memory.
The point is reciprocal: the firmness of one's grip on the Torah determines the measure of life it imparts to him.
וכ"כ אשרי אדם עוז לו בך בהקב"ה ובכ"ב אתוון דאורייתא שנק' עוז
And so too it is written, "Fortunate is the man whose strength is in You" (Tehillim 84:6) - that is, in the Ribono shel Olam, and in the twenty-two letters of the Torah, which are called "strength" (oz).
A supporting verse shows that a person's true strength comes from clinging to the Ribono shel Olam and to the twenty-two letters of the Torah, which Scripture calls "oz," strength.
ועי"ז מסלות בלבבם שנחקקו בלבבם דברי תורה
And through this, highways are formed within their hearts ("in whose heart are the highways," Tehillim 84:6), for the words of Torah become engraved within their hearts.
When Torah is engraved on the heart, it carves out inner "highways" or pathways, so that the words of Torah become a permanent, accessible part of one's inner self.
וכ"כ אסוף את העם ואתנה להם מים שע"י התאספות בנ"י נפתח פי הבאר
And so too it is written, "Gather the people together, and I will give them water" (Bamidbar 21:16) - for through the gathering together of Bnei Yisrael the mouth of the well is opened.
Another verse teaches that the water of Torah flows when Bnei Yisrael gather as one - their unity is what opens the wellspring.
וזה ג"כ מה שנברא פי הבאר בע"ש ביה"ש כי בשבת מתאספין בנ"י ומתאחדין ברזא דאחד:
And this too is the meaning of the well's mouth having been created on Erev Shabbos at twilight (bein hashmashos), for on Shabbos Bnei Yisrael gather together and become unified in the secret of "One" (raza d'echad).
This is why the mouth of the miraculous well was among the things created at the twilight of the first Erev Shabbos: it belongs to Shabbos, the time when Bnei Yisrael gather and unite in the secret of Hashem's Oneness.
Summary: This piece of the Sfas Emes meditates on the well in the wilderness and the Torah's song over it, reading the phrase "with the lawgiver, with their staffs" as referring to the engraving (chakikah) of Torah upon the heart. Citing his grandfather, he teaches that the Torah engraves itself into a person precisely to the degree that he trusts and grips it - like a drowning man clinging to a rescue rope on which his life depends - so that the measure of one's hold determines the measure of life received. This clinging to the Ribono shel Olam and to the twenty-two letters of the Torah, which Scripture calls "oz," strength, carves inner "highways" of Torah into the heart. Finally, he connects the flowing of the well's waters to the unity of Bnei Yisrael: just as "gather the people and I will give them water" shows that the well opens through their gathering, so too the well's mouth was fashioned at the twilight of the first Erev Shabbos, because Shabbos is the time when Bnei Yisrael unite in the secret of Hashem's Oneness, and it is through that unity that the wellspring of Torah is unsealed.