David committed adultery with Bathsheba, and then had her husband killed in battle. The Lord would not let David enjoy the fruit of these sins, and so the child that he and Bathsheba had created, would die, and the Bible says,
Then on the seventh day it came to pass that the child died. And the servants of David were afraid to tell him that the child was dead. For they said, “Indeed, while the child was alive, we spoke to him, and he would not heed our voice. How can we tell him that the child is dead? He may do some harm!” (2 Samuel 12.18).
This is one of those passages that the number 7 seems incidental, yet, when we think on it more, it appears to have significance.
It appears to be incidental, because no symbolic attachment seems connected to it. Yet, it appears significant, because the Lord brought about or at least allowed, the child’s death. The Lord allowed David to enjoy the little boy for seven days, but then took him away. Truly, the Lord does everything perfectly and completely, just as the number 7 symbolizes.