The superscription in Psalm 3 says that it is a psalm connected to David fleeing from his son Absalom. Absalom had turned the hearts of Israel against King David and was seizing the throne and David had no choice but to make a hasty escape from Jerusalem.