From the content, it would seem safe to assume that David is not in a happy place at the writing of this psalm. He is lonely and afflicted; troubled to his core. But that’s not where he starts. His starting point is, ‘In you, LORD my God, I put my trust.’ In other psalms we see him coming to this place after he has poured out his pain and frustration, but here the trust comes first.
We keep our hearts well defended, at least that’s my experience. The more we are hurt, the tighter our defences become. The more we give our hearts away and are disappointed, the more we keep them heavily guarded. This phrase about the gates lifting up their heads made me think of men defending a gate, keeping their heads down, not even looking at what might be approaching.
This is a song written in the most desperate of circumstances. Again, we don’t know exactly what David was going through but we do see his pain and anguish and we know that this psalm also contains elements of Messianic prophecy and words that Jesus would later utter as he hung, dying on the cross, abandoned by everyone and everything.