2 Samuel 12:21

Then said his servants unto him, What thing is this that thou hast done? thou didst fast and weep for the child, while it was alive; but when the child was dead, thou didst rise and eat bread.

The verse stands in the history of David's sin in the matter of Uriah, when he departed from God and used the position and authority God had given him to command what was contrary to God's law. Specifically, David made Uriah the bearer of his own death-warrant to Joab, directing Joab to set Uriah in the forefront of the hottest battle and retire from him so he would be smitten and die, and Joab, already stained with the guilt of one wanton murder, obeyed without hesitation, so Uriah fell by the sword of the children of Ammon. While the stricken child lived, David fasted in deep humiliation and pleaded for its life, putting off his royal robes, laying aside his crown, and lying on the earth night after night in heart-broken grief, interceding for the innocent one suffering for his guilt, and he would not be raised by the elders of his house. He persevered in supplication so long as the child was spared because humiliation and repentance had often turned aside pronounced judgments upon persons or cities, and he hoped the Ever-Merciful, who is swift to pardon, would send peace.

When the child died, David rose and ate bread, ending the fasting and mourning he had kept while the child was alive. In rising he quietly submitted to the decree of God as the first stroke of the retribution he himself had declared just, and trusting in God's mercy he was not without comfort. The verse is an example of accepting a loss and turning from grief over the dead rather than remaining bound to sorrow.