Leviticus 16:1 “And the LORD spoke unto Moses, after the death of the two sons of Aaron, when they drew near before the LORD, and died;”
Jerusalem Talmud Chapter1 Halachah 1 “After the death of… A braita teaches: why does it mention their death in the context of Yom Kippur? To teach that just as Yom Kippur atones for Israel, so too the death of the righteous atones for Israel.”
Torah Temimah Colloquial Translation on Note #1:
The reason and value of why the death of the righteous atones is not clearly explained. It appears according to what is written in Pirkei of Rabbi Eliezer chapter 17 regarding the death of Saul (II Samuel 21:14):” And they buried the bones of Saul and Jonathan his son in the country of Benjamin in Zela, in the sepulchre of Kish his father; and they performed all that the king commanded. And after that God was entreated for the land.”
When The Holy One Blessed is He saw how they dealt kindly with him (they fasted, cried and eulogized as the verse explains), He was filled with mercy, as the verse says “And after that God was entreated for the land.”
Inferred from this, is that death alone does not atone rather the honor and mourning accorded upon the death of the righteous, which is the honor of Hashem, atones.
Editor’s note: Judaism is not a religion of saints. The concept of one dying to atone for the congregation is antithetical to Judaism. While there is a custom to visit the cemetery during the month of Elul up through Yom Kippur, the Mishnah Berurah is adamant that one’s focus should not be on praying to the deceased rather one should entreat Hashem to help in the merit of the righteous. The death and merit of the righteous do not magically atone for us. It is the honor we give them and the lessons we learn from how they lived their lives that should change us for the better so that Hashem will help us in their merit.