In 2 Samuel 18, David commanded his men not to harm his son Absalom. Joab took things into his own hands and rebelled against that order. As Christians, we need to be teachable and respect the chain of command in our lives. We should operate out of a biblical worldview and let the word of God guide us.
In 2 Samuel 17, Absalom finds that Hushai's advice is better than Ahithophel's. The Lord caused Absalom to have bad advice, but Absalom did not realize that Hushai was an advocate of David. As believers, we can trust in God's sovereignty even if the odds are against us and live in the presence of the Lord.
2 Samuel 16 describes how Ahithophel is giving Absalom bad advice. David had refreshed himself and he was now thinking rightly and keeping his eyes up, looking to the Lord. The Lord was the one who was frustrating the good advice of Ahithophel in order to bring disaster on Absalom. As Christians, we need to be able to discern what is godly advice and what is worldly advice. God is sovereign, and the Word of God helps us see clearly.
What is our aim in life? The world will rapidly change around us, but as believers, our aim has to be on the Lord Jesus Christ who never changes. David could have gotten immediate revenge in 2 Samuel 16, but he refreshed himself in the Lord. David had the right aim in life. Do we?
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.