The Wise Woman Speaks to Joab from the Wallby emmanuel_higgins

2 Samuel 20:17

And when he was come near unto her, the woman said, Art thou Joab? And he answered, I am he. Then she said unto him, Hear the words of thine handmaid. And he answered, I do hear.

2 Samuel 20:17 stands in the inspired history of the reign of David, namely the history in 2 Samuel 11-24 and 1 Kings 1-2 that follows his great wickedness in the case of Uriah, by which he gave great occasion to the enemies of the Lord to blaspheme. Within that history it belongs to the account of David's difficulties, including his return to Jerusalem and his troubles with Joab, specifically the revolt of Sheba son of Bichri. Sheba's revolt broke out of the quarrel between the men of Judah and the men of Israel after the suppression of Absalom's revolt, threatened to prove very serious, and formed one of David's continuing troubles as a judgment of God for his sin in the case of Uriah.

That history openly records the terrible denunciation of the prophet Nathan and shows how completely that denunciation was accomplished in the judgments that came upon David. It is told with detailed faithfulness that stamps the account with inspiration, showing that God does not hide the sins of even the greatest kings. It does so without covering up or in any way excusing David's great transgression, and it places David's own humble confession of his transgression on record for all future time.