Bamidbar20: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.

Bamidbar 20:1

וַיָּבֹאוּ בְנֵי־יִשְׂרָאֵל כָּל־הָעֵדָה

Bamidbar / Numbers 20:1 · Sod

Bamidbar 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.

Sod סוֹד

Leaders for one generation

A teacher who led one class beautifully does not always suit the next. A new time asks for a new way.

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

Shem MiShmuel And the children of Israel came, the whole congregation

Rashi writes: "the congregation complete: those destined to die in the wilderness had already died, and these were set apart for life." And Ramban asked: if so, why mention it again when they came to Mount Hor?

It seems to me that the matter is this. These three, Moshe (Moses), Aharon (Aaron) and Miryam (Miriam), were sent to Israel together. The way Moshe led the people suited precisely the generation of the wilderness and not those who would enter the land, as the holy Zohar says in many places. More than that, entering the land would have been a descent for Moshe, because his level was higher, and so his way did not suit those entering the land. Surely so too Aharon and Miryam, sent together with him: their way did not suit the generation entering the land.

Therefore the Eternal brought it about that they died in the wilderness: Miryam died of old age, and for Moshe and Aharon the Almighty brought about the occasion of the waters of Merivah. By this one can explain why Scripture mentions that the wilderness generation had already passed both before Miryam's death and before Aharon's death. The reason is one: to show that because the wilderness generation had passed and a new generation, the one entering the land, had begun, therefore they died. And Ramban's question is settled.

Takeaway

The words "the Almighty brought it about" (הָאֱלֹהִים אִנָּה לְיָדוֹ) come from the Torah (Shemot / Exodus 21:13): they speak of something that happened not by a person's will.
The waters of Merivah are the place where Moshe (Moses) struck the rock, and the Eternal said that Moshe and Aharon (Aaron) would not bring the people into the land (Bamidbar / Numbers 20:12–13).
Ramban asks because the words "the whole congregation" are said again at Mount Hor, before Aharon's death (Bamidbar / Numbers 20:22).