ולא היה מים לעדה. כשמתה מרים נסתלק הבאר כי היה הבאר בזכות מרים שהיה לה זכות המים ממשה, שנאמר (שמות ב׳:ד׳) ותתצב אחותו מרחוק. ומה שנסתלק עתה במיתתה ראיה שבזכותה היה עמהם, ומכאן שכל ארבעים שנה היה להם הבאר. ולא היה מים לעדה, “The congregation had no water.” As soon as Miriam died, the well which had traveled with the Israelites all these years ceased providing water. The water which the people had enjoyed all these years was due to the merit of Miriam who had stood by watching what would happen to her infant brother when he was in a basket in the reeds at the edge of the river (Exodus 2,4). G’d had rewarded her for that act of kindness by making her the provider of water for Moses’ people. The people had not appreciated this until the well ceased with Miriam’s death.
ואמרו במדרש (במדבר כ״א:י״ז) אז ישיר ישראל את השירה הזאת, שירה זו נאמרה בסוף ארבעים שנה, והבאר נתן להם מתחלת ארבעים. Our sages in Tanchuma Chukat 20 claim that the song Israel sang in Numbers 21,17, i.e. אז ישיר ישראל את השירה הזאת, “then Israel would sing this song, etc.,” was sung at the end of the forty years whereas the well had been provided for them at the beginning of the forty years.