David is trying to figure out who he can trust and who is for real. God's sovereignty is at play as David leaves town and prays for wisdom. In 2 Samuel 16, David realized that Ziba, whom he thought was a friend, was actually throwing Mephibosheth, Saul's grandson, under the bus. Later, Shimei threw stones at David and cursed him, but David remained calm and he knew that God was in control and His timing is perfect.