The questions David raised in verse one of Psalm 15 were no doubt prompted by his concern to establish the true worship of God. David wanted to be sure that God would be pleased with the service and worship to Him in the newly erected tabernacle (tent), especially since God had been displeased with the first attempt to bring the Ark up to Jerusalem (2 Samuel 6:1-11). David appointed the Levites for all the various duties in connection with the tabernacle, but he understood that, more than their family lineage, godliness was the key requirement to serve the Lord, dwell near His Holy presence, and approach Him for true worship.
David firstly listed the qualifications of godliness in a positive sense. He saw that godliness must encompass every aspect of one's life: "walks uprightly" having no deviation from the truth (cf. Proverbs 28:18; Isaiah 33:15-17); "works righteousness", putting the truth of God into practice; and "speaks the truth", having pure intentions and honest motivations (15:2). There is no guile or deceit in the true citizen of Zion, for his heart is set on God, and he is thus dependent upon the truth. He does not break the ninth or tenth commandments (does not speak falsely, nor covet) regarding his treatment of a neighbour. He is an honourable man of integrity and one who shows respect, compassion, and kindness to his fellow man (obeys the law — Leviticus 25:35-37; Deuteronomy 16:19; 27:25). All of this stems from the fact that he fears (honours, respects, obeys) the Lord. Those of any nationality, who are born of God by receiving Jesus, are the true citizens of Zion and the royal priesthood of God (John 1:11-13; 1 Peter 2:9-10).
Psalm 16 was likely written during David's days as a fugitive in exile, when he had nothing except the Lord. It beautifully expresses the walk of faith and begins by showing the signs of a believer: one who puts his trust in God, declares Him to be Lord, rejoices to see others living righteously, and has nothing to do with idolatry or those who practice it (16:1-4).
The psalm goes on to express the present blessings of the believer. The greatest blessing is to have the Lord as one's inheritance. In the psalmist's day, the most important possession was land, for they lived off their land. The Levites, however, as wholly consecrated servants of God, were not assigned an allottment of land for their inheritance when they entered the Promised Land, because their inheritance was the Lord (Numbers 18:20). Since the Lord is the believer's inheritance, the believer has the most perfect and pleasant portion; it is like having the best land and nothing more is desired. His cup is full and his thirst has been quenched. In the Lord, the believer finds satisfaction, contentment, and safety (16:5-6). David could confidently say: "I shall not be moved", for he had set the Lord before him, and therefore God, his inheritance, would remain with him (16:8). This brought David great joy, hope, and life (16:9-11).
In this same passage, the Holy Spirit revealed the mystery of the resurrection of Jesus Christ, God's "Holy One", whose body would not see corruption. Such an interpretation was confirmed by the apostles Peter and Paul (Acts 2:25-28; 13:35). It is through Jesus that God shows us "the path of life", for as Jesus Himself said, "Because I live, you will live also" (John 14:19).
Psalm 17 is a desperate prayer of the righteous for vindication, divine intervention, and protection from enemies. It was likely written while David was a fugitive in the wilderness. He was confident of his integrity, since God had tested, visited, and tried him, but nothing evil was found (17:3a). Therefore, he had no doubt that God would save him from the oppression and injustices of his enemies (cf.l Samuel 24:11-12).
The reasons David gave for his purity are (1) he had made a strong personal resolution not to transgress the Law of God; it was a deliberate decision of his will, and (2) by the Word of God (reading, meditating, and following it) and through prayer for God's help, he had the strength to keep on the straight and narrow path (17:3b-5). Since he was a faithful and trusting child of God, he was sure that God would hear his prayer and protect him. His only refuge from the threat of the roaring lion (cf. 1 Peter 5:8) was to be found under the all-protective wings of a loving God. So he asked, "Keep me as the apple of Your eye" (17:8), that God might take special care of him as one would care for his pupil, a very precious part of one's body. In this plea, David was asking to be the center of God's attention, so that his life would be delivered from the wicked, worldly men who, unlike himself, had no portion in God. The men of the world receive their satisfaction from their material possessions and children (17:14), but David looks to a fuller satisfaction: "I will be satisfied with seeing your likeness" (N.I.V., 17:15).