Bamidbar / Numbers 20:1
וַיָּבֹאוּ בְנֵי־יִשְׂרָאֵל כָּל־הָעֵדָה מִדְבַּר־צִן בַּחֹדֶשׁ הָרִאשׁוֹן וַיֵּשֶׁב הָעָם בְּקָדֵשׁ וַתָּמָת שָׁם מִרְיָם וַתִּקָּבֵר שָׁם׃
And the children of Israel, the whole congregation, came into the wilderness of Tzin in the first month, and the people stayed in Kadesh. And Miryam (Miriam) died there and was buried there.
Pshat פְּשָׁט
The fortieth year
Rashi: "the whole congregation" is the new generation: those destined to die in the wilderness had already died. Miryam's (Miriam's) death stands next to the red cow because the death of the righteous atones, like offerings. Rabbeinu Bahya: this is the fortieth year. Chizkuni: they stayed in Kadesh four months, until Aharon's (Aaron's) death in the month of Av.
How Rashi, Rabbeinu Bahya, and Chizkuni explain it
Remez רֶמֶז
There, where Miryam died
The Talmud: the word "there" (שָׁם) is said both of the death of Moshe (Moses) and of the death of Miryam (Miriam), so she too died by a kiss. Rabbeinu Bahya: "and stayed" (וַיֵּשֶׁב) speaks of trouble, so right after it come Miryam's death and the story of the rock. Rabbi Nachman hears in Tzin (צִן) "cooled" speech, and in the name Miryam bitterness.
How Talmud, Bava Batra, Rabbeinu Bahya, and Likutei Moharan explain it
Drash דְּרָשׁ
Three gifts
The Talmud: Israel had three providers, Moshe (Moses), Aharon (Aaron) and Miryam (Miriam), and three gifts through them: the manna, the clouds of glory and the well. Miryam died, and the well disappeared, and in the next verse "there was no water." Aharon died, and the clouds disappeared. The well and the clouds returned by Moshe's merit, and with his death all three disappeared.
How Ein Yaakov explain it
Sod סוֹד
Leaders for one generation
Shem MiShmuel: Moshe (Moses), Aharon (Aaron) and Miryam (Miriam) were sent together, and their way suited the generation of the wilderness, not those who would enter the land. So when the wilderness generation passed, they passed too. Miryam died of old age, and for Moshe and Aharon the Almighty brought about the occasion at the waters of Merivah.
How Shem MiShmuel explain it