In this verse, the author names several characteristics or character traits of the Lord. Because the Lord is like this, he has helped him. The underlying reason that the Lord helped him is not the pleading of the author, but the inclination of the Lord’s heart. He is gracious and righteous. Gracious
in a general sense is the affable or friendly attitude of a superior over against someone below him.
When this is about God and man, this attitude says even more because God is so far above us.
We should also realize that there is no reason whatsoever in man why God would take on such a friendly attitude. God is, as this verse continues, also righteous. He does what he has said he would do.
Although these two (saying & doing) characteristics are almost always in conflict in man, with God they are both completely true, and the one does not diminish the other. It then flows from God’s characteristics that he is merciful. The word merciful
has as its basic meaning the notion of compassionate.
5 Gracious is the LORD, and righteous; our God is merciful.