Similar to Psalm 18, 138 is a song of thanksgiving for God's saving acts–especially against enemies. After first praising the LORD for answering prayer (v. 3; st. 1), the psalmist expresses a desire that all the kings of earth be moved to add their praise to God; they too should see the greatness of God's glory. Even though the LORD is "on high," God does not identity with the proud but looks favorably on the lowly (st. 2). God's deliverance of the psalmist is an example of this care. The psalmist professes confidence in God's continued care and commits the future to the LORD in a closing prayer (st. 3). Stanley Wiersma (PHH 25) versified this psalm in 1981 for the Psalter Hymnal. Another setting of Psalm 138 is at 183.
Psalter Hymnal Handbook
We do not walk with God to gain his attention and favor, but rather to exhibit our profound thankfulness to him. Heidelberg Catechism, Lord’s Day 1, Question and Answer 1 makes it clear that “because I belong to him, Christ…makes we heartily willing and ready from now on to live for him.”
In addition, Heidelberg Catechism, Lord’s Day 32, Question and Answer 86 gives us a beautiful and moving testimony of why God’s children are called to live obediently: Christ has redeemed us by his blood. Therefore, God’s children are called to “show that we are thankful to God for his benefits.”