In a strong city - If this Psalm was written by David, this must refer to his taking refuge with achish, king of Gath, who gave him Ziklag, a fortified city, to secure himself and followers in. See 1 Samuel 27:6. This is more likely than that it was Keilah, where he only had intimation of the traitorous design of the inhabitants to deliver him up to Saul; so that the place was no refuge to him, howsoever fortified. Perhaps the passage may mean that, under the protection of God, he was as safe as if he had been in a fortified city.
Blessed be the Lord - An expression of thanksgiving for the evidence that God had heard him in his troubles, and had answered him.
For he hath showed me his marvelous kindness - literally, “He has made his mercy wonderful;” that is, he has showed me such mercy as to be an object of admiration and astonishment. It was not ordinary kindness, such as is shown to people every day; it was so uncommon - so far beyond all expectation - so separate from second causes and the agency of man - so marked in its character - as to fill the mind with wonder.
In a strong city - Margin, “fenced city.” This may mean either that he had thus placed him literally in a strongly fortified city where he was safe from the fear of his enemies; or, that he had interposed in his behalf, and had given him protection as if he had brought him into such a strongly fortified place. Jarchi supposes that the city of “Keilah” 1 Samuel 23:7 is here intended. But this is improbable. All that the passage necessarily implies is, that God had given him protection as if he had been placed in a strongly fortified town where he would be safe from danger.