In these passages King David expresses his trust in God. He was fleeing from his son, Absalom, who was leading a rebellion against David. David was in a precarious situation, and he placed his trust in God. That was David’s best and only choice.
That too is our best choice in any precarious situation we may find ourselves in. When we place our trust in God, God will protect us. David said, “You O Lord are a shield for me.” So, too, is God a shield for us to protect us from all evil.