He must restore the lamb fourfold, because he did this thing and because he had no pity!” Bible

“He must restore the lamb fourfold.” Repaying fourfold for stealing and slaughtering a sheep was demanded in the Mosaic Law (Exod. 22:1). There is little doubt that David knew the law, but being human he had a hard time keeping it and overcoming his personal weaknesses.

Commentary for: 2 Samuel 12:6