The expression “from the depths” connotes “deep water”, and this is a metaphor for the dire straits in which the worshipper finds himself. The psalm describes a person who is praying because he feels that he is about to drown; thus, God’s aid is a vital and immediate need.
The “depths” in which the worshipper finds himself, and from whence he called to God, are a metaphor for his sins.
However, the great distress which the worshipper suffered in stanza a. is eased somewhat once he has given thought, in stanza b., to the well-known truth that “with God is forgiveness." Now he is certain that God has indeed heard his voice and has listened to his supplications.