Psalm 17 asks God, the heavenly King and Judge, to protect his faithful servant from the unprovoked attacks of godless enemies. It appears that the enemies hope to profit from the psalmist's death or downfall, perhaps to fatten their purses with worldly wealth (v. 14), and they seem to have the power to bring him down (vv. 10-12). As in many psalms, it could be that the enemies attack the LORD's anointed with false accusations (v. 10), and the only recourse is to call for God's righteous judgment. The psalmist appeals to God to hear his just cause (st. 1) and declares trust in God's safekeeping (st. 2). A prayer follows, in which the psalmist implores God for safe sanctuary and rescue from plotting and threatening enemies and expresses full confidence in God's provision and in the believer's ultimate joy in God's presence (st. 5).
Bert Polman, Psalter Hymnal Handbook
Belgic Confession, Article 26 provides the foundation for all our praying: “We believe that we have no access to God except through the one and only Mediator and Intercessor ‘Jesus Christ the righteous,’ who therefore was made human, uniting together the divine and human natures, so that we human beings might have access to the divine Majesty. Otherwise we would have no access.” We offer our prayers, therefore, “only on the basis of the excellence and dignity of Jesus Christ, whose righteousness is ours by faith.” Heidelberg Catechism, Lord’s Day 46, Question and Answer 120 verifies this privilege when it says, “Through Christ God has become our Father, and…just as our parents do not refuse us the things of this life, even less will God our Father refuse to give us what we ask in faith.”