2 Samuel 18:13

Otherwise I should have wrought falsehood against mine own life: for there is no matter hid from the king, and thou thyself wouldest have set thyself against me.

The verse belongs to the account of Absalom's rebellion against David, which ended in Absalom's defeat and death. It was David's own son Absalom who rebelled against him and sought his life. The soldier spared Absalom because he feared the king's response, knowing David would learn what he had done and turn against him, so he instead reported Absalom's plight to Joab.

The rebellion brought David great distress as a bitter consequence of his own wrongdoing. That wrongdoing thus came into his own family, making him feel the injustice he had done to Uriah and Bath-sheba.