Numbers 20:2 – The congregation had no water; so they assembled against Moses and Aaron.
Gemora Taanit 9a: It was taught in a Beraita as follows: Rabbi Yosi the son of Rabbi Yehuda said that the Well was given through the merit of Miriam. Therefore, when Miriam died, the Well ceased. This is proven by the verses that state “Miriam died and there was no water for the congregation.”
Torah Temimah Colloquial Translation on Note #8
Note also the Gemora in Baba Metzia 87b where it states that the Well was given due to the merit of Abraham’s stating to his guests “let a little water be brought [for you]” (Genesis 18:4). The Maharsha asks how can it say here in our Gemora that the Well was due to the Merit of Miriam? Also, what would it mean to refer to it as the Well of Miriam if it was given due to the merit of Abraham? The Maharsha’s response is that if God had considered only the merit of Abraham, the Well would have lasted only for a short period of time. It was only through the merit of Miriam that it lasted all forty years that they were in the desert.
These words of the Maharsha seem not to make sense. How could he possibly say that Miriam’s merit was greater than Abraham’s and say that Abraham’s merit would have sufficed only for the Well to last a short period of time?!
It appears to me that the explanation of the difference between these two Gemoras is that because of the merit of Abraham, the Jews merited to have a woman of Miriam’s qualities who then, in her merit, the Well would be given that would last forty years. In this same manner are we able to explain other examples where the Pillar of Fire and the Manna are also attributed to Abraham and Also to Aaron and Moshe respectively.
Editor’s Note: I appreciated the Torah Temimah’s solution that gives honor and glory to both Abraham and Miriam and does not diminish either one.