2 Samuel 20:3
And David came to his house at Jerusalem; and the king took the ten women his concubines, whom he had left to keep the house, and put them in ward, and fed them, but went not in unto them. So they were shut up unto the day of their death, living in widowhood.
The verse belongs to the later history of David's reign at Jerusalem after Absalom's revolt was suppressed, when a quarrel broke out between the men of Judah and the men of Israel and gave occasion for the revolt of Sheba son of Bichri, which threatened to prove a very serious thing. Its wider setting is the difficulties of that reign and David's inability to control his sons, including Absalom's rebellion and the death of the petted idol of the kingdom, David's lament and his return to Jerusalem, his troubles with Joab, and his numbering of the people. The detailed faithfulness with which all this is recorded stamps the account as inspired.
It is part of the record of sad family troubles, misery, and consequences that grew out of David's multiplying wives, and it illustrates the evil of having many wives, to which practice much of the misery that came upon David is traced. The troubles shown here were not yet ended, for the sword continued in his house for his sin in the case of Uriah. In this way Nathan's denunciation was completely accomplished in the judgments that came upon David.
The account does not cover up or excuse David's great wickedness, but openly records it, and David himself recorded a humble confession of his great transgression for all future time. That openness shows that God does not hide the sins of even the greatest of kings.