To the chief Musician, A Psalm of David. This psalm is applied by R. Obadiah to Haman and Mordecai. The enemy is Haman, the perfect man shot at is Mordecai; about whom Haman communed with his friends to lay snares for him, and searched diligently for occasions against him and his people, which issued in his own destruction. The ancient Midrash {y} of the Jews applies it to Daniel, when cast into the den of lions; and Jarchi supposes that David, by a spirit of prophecy, foresaw it, and prayed for him who was of his seed; and that everything in the psalm beautifully falls in with that account: Daniel is the perfect man aimed at; the enemy are the princes of Darius's court, who consulted against him, communed of laying snares for him, and gained their point, which proved their own ruin. But the psalm literally belongs to David, by whom it was composed. The Arabic versions call it a psalm of David, when Saul persecuted him; and the Syriac version refers it to the time when Gad said to him, abide not in the hold, 1 Samuel 22:5. He is the perfect man, who was upright and innocent as to what he was charged with in respect to Saul; who is the enemy, from the fear of whom he desires his life might be preserved; and who with his courtiers took counsel against him, and laid deep schemes to destroy him, but at last were destroyed themselves. Moreover, the psalm may very well be applied to the Messiah, the son of David, and who was his antitype, and especially in his sufferings: he is the perfect man in the highest sense; the Jews were the enemies that took counsel, and searched for occasions against him, and accomplished their designs in a good measure; for which wrath came upon them to the uttermost. The psalmist also may be very well thought to represent the church and people of God; who in all ages have had their enemies and their fears; against whom wicked men have devised mischief, and levelled their arrows of persecution; though no weapon formed against them shall prosper.
{y} Apud Jarchium & Yalkut Simeoni in loc.