2 Samuel 20:11
And one of Joab’s men stood by him, and said, He that favoureth Joab, and he that is for David, let him go after Joab. And one of Joab’s men stood by him, and said, He that favoureth Joab, and he that is for David, let him go after Joab.
The verse belongs to the detailed later history of David's reign recorded in 2 Samuel 11-24 and 1 Kings 1-2, and records part of his troubles with Joab. Its immediate setting is the revolt of Sheba the son of Bichri, which grew out of the quarrel between the men of Judah and the men of Israel after Absalom's revolt was suppressed and threatened to prove very serious. It stands among David's troubles that were not yet ended, one of the calamities directly traceable to his sin in the case of Uriah under the chastening hand of God by which the sword never departed from his house. This came in complete accomplishment of the terrible denunciation of the prophet Nathan after David by his great wickedness gave great occasion to the enemies of the Lord to blaspheme.
The same troubles are described as part of the troubles in David's family that grew out of his multiplying wives. These events teach that people cannot break God's laws without suffering, because transgression carries an inherent curse. The judgments that came upon David after his great wickedness are not covered up or excused but are placed on record together with his own humble confession of his great transgression for all future time.