(Today's passage covers David's many conquests; his kindness towards Mephibosheth, Jonathan's son; his defeat of the Ammonites and Syrians; his affair with Bethsheba, and the aftermath thereof.)
In today's passage, we see the odd reasoning of David's mind. It seems he acts first and rationalizes later, trying to do what's right, but when that fails, doing what's necessary.
Perhaps an example is in order.
In 2 Samuel 11, David is staying at home in Jerusalem while his general Joab besieges Rabbah. While he's walking along a rooftop, he sees a beautiful woman, Bethsheba, bathing herself. David is smitten and has her sent over. He sleeps with her and she conceives a son. (2 Sam. 11:1-5)
Now, David doesn't want any trouble. So he has Bethsheba's husband Uriah sent back from the fronts on the pretence of getting an update about the war. David sends Uriah home, assuming he'll sleep with Bethsheba and thus will be able to claim that the child is his own, letting David get off home free. (2 Sam. 11:6-8)
But Uriah doesn't go home. Instead, he sleeps on the porch of the palace with David's servants. David is dismayed and asks Uriah why he didn't go home. Uriah answers (and I paraphrase), "The ark sleeps in a tent. Israel and Judah sleep in tents. My lord Joab, fighting at Rabbah, sleeps in a tent. How can I, in good conscience, sleep in my house?" (2 Sam. 11:11)
David gives Uriah two more days, but each day Uriah sleeps with the servants and not in his own house.
Now, David had done all he could to fix his mistake, but Uriah refused to take the bait. If Uriah couldn't claim the child as his own, there was only one thing to do, David reasoned, which was to have Uriah killed so that he could rightfully claim the child himself. So David sent a letter, delivered by Uriah himself, to General Joab, telling him to place Uriah at the very front of the troops. Joab does, and Uriah is killed in a hail of arrows. (2 Sam. 11:12-17)
Joab sends back a messenger, who tells David everything that happened. Joab thinks that David will be upset, but that's only because he doesn't know the back-story. David tells Joab not to worry and to press his attack. Meanwhile, he, David, waits until Bethsheba is finished mourning and promptly marries her. (2 Sam. 18-27)
But all is not well. Even though David thinks he was being remarkably sneaky about the whole affair, God knows everything, and God is not happy. God sends Nathan, his prophet, to chide David with a parable about two men, one rich and one poor. When a traveller arrives from far away, the rich man chooses to slaughter the poor man's only ewe instead of taking one of the many sheep from his own fields. (2 Sam. 12:1-4)
David is outraged at the rich man, until Nathan tells him, "The rich man is you." David sees the error of his ways, and God lessens the punishment from "you will die" to "the child will die." (2 Sam. 12:5-14)
Indeed, the child falls ill, and David does everything in his power to intercede. He fasts. He sleeps on the ground. He prays. But after seven days, the child dies anyway.
The servants are afraid to tell David, thinking (quite understandably) that if David mourned so much for the child while it was still alive, he would be completely inconsolable now that the child was dead. Instead, David hears the news, gets dressed, and sits down to a meal. (2 Sam. 12:15-20)
The servants are confused. "Why," they ask him, "are you eating, now that the child is dead, when you were fasting while it was alive?" (2 Sam. 12:21)
And here, I think, we see the true genius of David. He replies, (and again I paraphrase) "When the child was alive, there was still a chance God would show mercy to me and allow him to leave. Now that he's dead, I can't bring him back, so what's the point in fasting?" (2 Sam. 12:22-23) Here we see David thinking clearly, logically, and ruthlessly. He's done all he could, but the past is past. Once there's nothing to do, there's no point in bemoaning the past. It is time to move on.
And move on David does, sleeping with Bethsheba again, who conceives Solomon. He also deals the finishing blow to Rabbah, just for good measure and to tie the whole story together. (2 Sam. 12:24-31)