"Yet God is my King of old, working salvation in the midst of the earth. Thou didst break the sea in pieces by Thy strength; Thou didst shatter the heads of the sea-monsters in the waters" (Psalm 74:12-13).
Michael Coogan wants to apply this passage to the creation account of Genesis 1:1, and so does the NAB:
"Comparable Canaanite literature describes the storm-god’s victory over all-encompassing Sea and its allies (dragons and Leviathan) and the subsequent peaceful arrangement of the universe, sometimes through the placement of paired cosmic elements (day and night, sun and moon), cf. Ps 89:12–13. The Psalm apparently equates the enemies attacking the Temple with the destructive cosmic forces already tamed by God. Why then are those forces now raging untamed against your own people?" (NAB Notes on Psalm 74:12-17).
But the context suggests that the psalmist is recounting the Exodus drama at the Red Sea. That was my intuition when I first read the passage and I've since found that a medieval rabbi named Rashi--who is big in exegetical circles--also applies these verses to the Exodus (not to the creation account). There's plenty of material written on Psalm 74, but I found that Spurgeon's "Treasury of David" likewise views this psalm in the light of Israel's deliverance from Pharaoh in the Red Sea:
"Working salvation in the midst of the earth. From the most remote period of Israel's history the Lord had worked out for her many salvations; especially at the Red Sea, the very heart of the world was astonished by his wonders of deliverance" (Treasure of David).
Joseph Benson makes similar points about these passages:
"Thou didst divide the sea, &c. — 'The first part of this verse alludes to that marvellous act of omnipotence which divided the Red sea for Israel to pass over; the second part to the return of its waves upon the heads of the Egyptians, who, like so many sea-monsters, opening their mouths to devour the people of God, were overwhelmed, and perished in the mighty waters.' — Horne. Thou brakest the heads of the dragons — The crocodiles, meaning Pharaoh’s mighty men, who were like these beasts in strength and cruelty. Thou brakest the heads — That is, the head of Pharaoh himself. He says heads, because of the several princes who were and acted under his influence. Dr. Waterland renders the first word, which we translate dragons, crocodiles, and the latter, the crocodile, meaning Pharaoh" (Joseph Benson's Commentary of the Old and New Testaments).