In 2 Samuel 16, David, who was now king of Israel, faced opposition and betrayal from various individuals. As he continued his journey of fleeing Jerusalem due to his rebellious son Absalom's attempt to seize the throne, David encountered a man named Ziba, a servant of Saul's house. Ziba provided David with donkeys and supplies, but it was later revealed that he deceived David by falsely accusing Mephibosheth, Jonathan's son, of treason.
During David's departure, a man named Shimei, from the family of Saul, cursed and threw stones at David and his men. One of David's companions suggested killing Shimei, but David refused, believing that God might have prompted Shimei to curse him. David acknowledged the possibility that he was being punished for his sins.
Meanwhile, Absalom arrived in Jerusalem, and Ahithophel, David's former counselor, joined Absalom's rebellion. Absalom sought advice on how to solidify his position as king, and Ahithophel suggested publicly sleeping with David's concubines to demonstrate his authority. This act fulfilled a prophecy concerning David's punishment for his affair with Bathsheba.
