“Thus Rachel died, and was buried on the way to Efrat, which is Beit Lechem. Yaakov set up a monument over her grave; it is the monument of Rachel’s grave until today” (Bereishit 35:19-20)
Why did Yaakov see fit to bury Rachel specifically in Efrat? He saw that in the future, the exiles would pass there. He buried her on the way so that she could ask for mercy for her children. This is referred to in the pasuk (Yirmeyahu 31:14), “A voice is heard on high, wailing, bitter weeping, Rachel weeps for her children; she refuses to be consoled for her children, for they are gone” (Bereishit Rabbah, Vayishlach, Parashah 82).
Praying at Kever Rachel is proven to be effective. Rachel was buried there for the express purpose of her children being able to pray there in the future (in the name of Rabbi Yitzchak Zev of Brisk).
“They ascended in the south and he came to Chevron” (Bamidbar 13:22)
Rava says (Sotah 34b) that from here we learn that Calev separated from the spies and went to prostrate himself at the graves of the Avot. He said, “My forefathers! Plead for mercy on my behalf, that I should be spared the plot of the spies!”
“I have no claim to Your goodness. For the holy ones who are [buried] in the earth and for the mighty – all my desires are in them” (Tehillim 16:2-3)
>Rashi expounds: For the sake of the holy ones who are buried in the land, who walked before You in truth. They are the mighty ones in whom all my desires are fulfilled, and in whose merit all my needs are met.
The Gemara asks (Ta’anit 16a) why one visits the cemetery. Rabbi Levi bar Chama and Rabbi Chanina differ in their opinions. One says it is to emphasize the fact that we are considered dead before Hashem, and the other says it is in order that the dead should beg for mercy on our behalf.
Torah Sages throughout the generations brought bounty upon everyone in their generation. All the more so, upon those who were connected to them. Even after death, the places of their burial contain the power of blessing. Hashem’s bounty rests upon their bones.
For this reason, our Sages state that it is fitting to prostrate oneself at the graves of the tzaddikim and pray there. Prayer at that place is most desired, as it is the place of rest of those who already earned Heavenly abundance (Derashot Haran, Eighth Drush).
When there are no tzaddikim in the generation and the Shechinah has nobody upon whom to rest, it rests upon the tzaddikim who have passed on (Be’ur HaGra L’Tikkunei Zohar).
It is a worthy custom to visit graves and increase charity (Shulchan Aruch, Orach Chaim, Hilchot Erev Yom Kippur, 605).
The graveyard is the resting place of the tzaddikim and is where prayers are more readily accepted. One should never place his faith in the deceased, but ask for Heavenly mercy in the merit of the tzaddikim. He should encircle the graves and give charity before making his requests. One should not visit the same grave twice in one day (Mishneh Berurah 581).
One should be extremely careful not to direct his prayers to the deceased. This would be similar to those who practice necromancy. Rather, one should ask Hashem to act with kindness toward him in the merit of the tzaddikim who are gone. They should increase their prayers and charity (Chayei Adam II – III, 138:5).