After Nathan the prophet reveals David's sin, David owns it and records for us his prayer to the Lord. This psalm is very instructive on repentance and the mercy and lovingkindness of the Lord.