A picture of grace...
In the scriptural story of David and Bathsheba, David commits both adultery and murder, breaking at least four of the ten commandments - probably more. (You shall not murder. You shall not commit adultery. You shall not steal. You shall not covet your neighbor’s house; you shall not covet your neighbor’s wife, or his male servant, or his female servant, or his ox, or his donkey, or anything that is your neighbor’s.) The penalty for adultery was: "If a man commits adultery with the wife of his neighbor, both the adulterer and the adulteress shall surely be put to death." (Leviticus 20:10)
The penalty for murder: "Moreover, you shall accept no ransom for the life of a murderer, who is guilty of death, but he shall be put to death." (Numbers 35:31)
The penalty for stealing (David stole his neighbor's wife): "If a man steals an ox or a sheep, and kills it or sells it, he shall repay five oxen for an ox, and four sheep for a sheep." (Exodus 22:1) (This is likely why David demanded that the man who had stolen his neighbor's sheep - in Nathan's story (2 Samuel 12) - repay the lamb fourfold.)
The penalty for coveting: That's the tough one, for how does one really know the content of a person's heart? Only God knows and He calls coveting wickedness. (Proverbs 12:12) Jesus said in Luke 12:15 ""Take care, and be on your guard against all covetousness, for one’s life does not consist in the abundance of his possessions."
The thing is, David knew that his actions deserved the death penalty. He knew the law. Kings were supposed to write a copy of the law for themselves when they took the throne. (Deuteronomy 17:18) And there was no wiggle room when it came to adultery and murder.
And yet God spared both David and Bathsheba. He even went so far to allow their heritage to include lineage in the line of their coming Messiah, Jesus Christ. Why? Why did God grant such great grace and forgiveness to David and Bathsheba? Why did He choose to set His love on their son Solomon? (2 Samuel 12:25 - Jedidiah, the name God gave Solomon, means beloved of the Lord.)
The answer is found in Jesus. It is why He came. Why He had to die on a cruel Roman cross. David did not have the full picture of grace during his lifetime, but God gave him a glimpse of what grace would do, of what love would do when the Messiah finally came to walk the earth. It was the hope of every Old Testament believer, and the hope of us today who see the bigger picture.
Romans 5:8 tells us: "but God shows his love for us in that while we were still sinners, Christ died for us."
And John tells us, "For God so loved the world, that he gave his only Son, that whoever believes in him should not perish but have eternal life."
When confronted with his sins, David instantly repented. He knew he had broken the law, and both he and Bathsheba knew they deserved death. And yet, God forgave their repentant hearts.
David and Bathsheba did not deserve that forgiveness. That's why we call it grace.