Bamidbar 20:1 – The entire congregation of the children of Israel arrived at the desert of Zin in the first month, and the people settled in Kadesh. Miriam died there and was buried there.
Gemora Moed Kattan 28a: It was taught in a Beraisa as follows: Rabbi Ami asked why is the narrative of the death of Miriam adjacent to the narrative of the Red Cow? He answered: to teach that just as the Red Cow atones for sins, so does the death of the righteous atone for sins.
Torah Temimah Colloquial Translation on Note #2
One needs to ask why the narrative of Miriam’s death is adjacent to the story of the Red Cow, specifically, and not next to many of the other ceremonies that also are meant to achieve atonement such as sacrifices or the clothing of the high priest. Perhaps one can explain the answer according to that which is stated by Rashi in the previous chapter (19:22) that the Red Cow is meant to atone for the sin of the Golden Calf. This is analogous to the mother coming and atoning for her child. In other words, the mother cow (Red Cow) is atoning for the calf (Golden Calf). Then with a slight linguistic change, one can say that this is similar to the death of Miriam in her role as the mother to the Jewish People.
[On the other hand] it is not clear what is meant, in general, by the statement that the death of the righteous people [somehow] cause an atonement and what would be the reasoning behind such a statement. Perhaps the answer is in accordance with the statement in Pirkei d’Rabbi Eliezer (Chapter 17) when it discusses the death of Shaul (in Samuel 2, Chapter 21) where it states
“And they buried the bones of Saul and Jonathan his son in the country of Benjamin in Zela, in the sepulcher of Kish his father; and they did all that the king commanded. And God was entreated for the land after that.”
Pirkei d’Rabbi Eliezer states that since God saw that the Jewish people dealt kindly [appropriately] with Shaul’s body [after his death] in that they fasted and cried and eulogized him, God then was filled with mercy towards the Jewish people. This is the meaning of the phrase “And God was entreated for the land after that.”
Thus, it is clear from here that it isn’t the death, itself, that causes the atonement. Rather, the mourning and the honor that are given to a great person who has passed away is what what causes God to [in a corresponding way] look kindly on the Jewish people because the honor that the people are showing to the great person is, essentially, showing honor to God.
Editor’s Note: The idea that the death of a righteous person somehow, magically, causes atonement to the living is a foreign concept to Judaism. The Torah Temimah is pointing out, in this note, that it is not the death itself that causes God to show mercy to the living; rather it is the kind manner and loving mourning for the deceased that arouses God’s mercy.