Psalms 72 to 150 consist of Book III, Book IV and Book V, which represent different periods of the Davidic Covenant.
Book III was the lowest point of the books of Psalms which included mostly laments. The people of Israel were losing their faith and hope in the LORD and they were distressed in crisis. They were praying for the LORD’s help in despondency, i.e. “I cry out in the night before you… incline your ear to my cry” (Ps 88:1-2). They were also questioning the LORD in prayers on His promises to David, “where is your steadfast love of old, which by your faithfulness you swore to David” (Ps 89:49), asking the LORD why He allowed David, His anointed, to suffer from the scorns of his enemies, but they did not get any immediate answers from the LORD.
Prayers are “the living relationship of the children of God with their Father” (CCC 2565). Just as St Augustine said, “God wills that our desire should be exercised in prayer, that we may be able to receive what He is prepared to give” (CCC 2737). Although the LORD might not immediately give us what we ask from Him in prayers, we do not need to be troubled but continue to pray, “for He desires to do something even greater for you, while you cling to Him in prayer” (CCC 2737).
In Book IV, when the sons of Israel were on exile in absence of the Davidic covenant, they meditated upon the LORD’s significance in their lives, i.e. they praised the LORD as “the rock of our salvation” (Ps 95:1), the “great God” (Ps 95:3) and proclaimed their obedience to Him. They also confessed all their sins and pleaded for the LORD to save them for “their sake of His covenant” (Ps 106). Their prayers were humble and prayed with contrite hearts, just as “man is a beggar before God” (CCC 2559). “Humility is the foundation of prayer” (CCC 2559) and it is only those who humble themselves will be exalted. Hence, in Book V, it held a dominant mood of praises and thanksgiving because the LORD had answered the prayers of the sons of Israel and the LORD had delivered them, rebuilt the Temple at Zion and restored the Davidic covenant with them forever.