David wrote this Michtam (musical cue) while he was in the custody of the Philistines in Gath. He asks for God’s mercy in the midst of his enemy’s pursuit of him.
Psalm 56:3–4 (NKJV)
3 Whenever I am afraid,
I will trust in You.
4 In God (I will praise His word),
In God I have put my trust;
I will not fear.
What can flesh do to me?
He goes on to talk about how his enemies twist his words, they wait to ambush him, they try to harm him. However, David knows that God numbers his wanderings, and puts his tears into a bottle. When David cries out, God will hear, and his enemies will turn back. David then speaks of the binding vows he made to God, gladly, because the Lord delivered his soul from death, kept his feet from falling, and allowed him to walk in the light of the living.
This psalm echoes a common theme in the psalms: though your enemies pursue you and harm you, God will deliver you if you will trust Him. Trust in the Lord!