A prayer of repentance to God from David after his adultery with Bathsheba. It says in 2 Samuel 12:16 that David pleaded with God for the child's life, it says that he fasted and lay all night on the ground for 7 days. I believe it was during this time that David was writing this. After Nathan was sent to him, he knew that he needed to make things right with God. I just picture David laying on the ground pouring his heart out to the Lord. He acknowledged his sin to the Lord and the Lord forgave him! David probably got to a point in his life when he wasn't in communion with God, and he wasn't crying out or relying on Him; so God used this to bring David closer to Him! O how this reminds me of me! I got to a point in my life where I wasn't close to God, and God used me being broken down to bring me back to relying on Him. I confessed my sins to Him, repented, and God created in me a new clean heart(as it says in verse 10). And God has done the same for you. So rejoice with me that Jesus has forgiven us, made us clean, made us spotless, and made us beautiful in His eyes. He truly loves us!