This psalm is by the Septuagint, Vulgate Latin, Syriac, Arabic, and Ethiopic versions, joined to the former, and makes one psalm with it: and Kimchi says, that in some books the psalm does not begin here; but in the best and correct copies of the Hebrew, and in the Targum, it stands a distinct psalm; and the different subject matter or argument shows it to be so. It is ascribed to various persons; by some to Moses and the Israelites, when pursued by Pharaoh: by others to the three companions of Daniel, cast into the fiery furnace: by others to Mordecai and Esther, when Haman distressed the Jews: by others to the heroes at the times of Antiochus and the Maccabees; so Theodoret: by some to Jehoshaphat, when a numerous army came against him; and by others to David, which is more probable; though on what occasion is not easy to say: some have thought it was written by him, when insulted by the Jebusites, 2Sa 5:6. The occasion of it seems to be some distress the church of God was in from the Heathens; and the design of it is to encourage trust and confidence in the Lord; and to excite the saints to give him the glory of all their mercies, and to expose the vanity of idols.