If you daven at kivrei tzaddikim, does this mean:
1) You are davening in the zechus that you visited the kever and thereby mechabed the niftar
2) You are asking the niftar to be a melitz yosher for you. (This seems like avodah zarah, but at hespeidim people say the niftar should be a melitz yosher?)
3) The zechus of the niftar works on your behalf because you visited their kever.
4) This has nothing to do with the zechus of the niftar at all and visiting the kever is simply a way for you to be mashpil yourself and thereby enhance the sincerity of your tefillos.
The issue of prayer at the graves of tzaddikim is mentioned in several sources, and a variety of reasons are given for its virtue.
1) The Gemara (Sotah 34b) writes that Kalev prayed at Chevron, beseeching the Patriarchs to pray on his behalf, that he should be saved from the evil of the Spies. A similar idea is mentioned in Sotah 14a, where the Gemara explains that the burial place of Moshe is hidden, so that people will not beseech Moshe to pray for the sake of Israel, and his prayers will annul all decrees.
These sources indicate that one can ask the departed to pray for our benefit. See also Taanis 23b.
2) The reason above (that the departed should pray on our behalf) is also mentioned by the Gemara in Taanis (16a), which also mentions an alternative reason: “Because we are considered before Him as though we are dead.” As the question notes (4), prayer at graves “way for you to be mashpil yourself and thereby enhance the sincerity of your tefillos.”
The Minhagim of the Maharil mentions a similar reason, whereby one’s prayer at graves is more powerful, as if to say: “If You do not have mercy upon us [it is as though] we are dead, Heaven forbid.”
3) The Mishnah Berurah (581:27) writes that one should not direct his prayers to the dead, but only to Hashem, praying to Him in the merit of the departed. Although this reason is perhaps the most “rational,” is it noteworthy that most sources do not mention this idea.
4) A reason mentioned by many sources for prayer at graves is that the graves of the righteous are holy places, and therefore virtuous for the acceptance of one’s prayer. This idea is mentioned in Shut Maharam (164), in Derashos Ha-Ran (Derush 8), by the Kitzur Shulchan Aruch (128:13; he also mentions that the departed will be meilitz yosher for us), and others.
Some authorities actually objected to prayer at the graves of the righteous, but the custom is cleary to do so, and it certainly has a noble tradition.