This psalm contains an end-time prophecy of the destruction of Edom, figuratively called the Daughter of Babylon. It is one of several prophecies that help identify Mystery Babylon with Arabia.
The first part of this psalm (v1-6) is a lament by the Jewish exiles during the time of the Babylonian exile in the 6th century BC. They remember Zion (Jerusalem), and lament its fall.

Verses 7 to 9 are an important end-time prophecy of the fall of Edom, referred to as the 'Daughter of Babylon'. The 'Daughter of Babylon' is Edom in Arabia, and not Ancient Babylon which is in modern-day Iraq. Edom is referred to as the Daughter of Babylon because in the latter part of the Babylonian Empire, Nabonidus, its last king, extended the Babylonian empire to include Edom and Arabia as far south as Yathrib (now Medina in Saudi Arabia). Nabonidus spent most of his reign in his Arabian colony at Tema (now Tayma in western Saudi Arabia), leaving his son Belshazzar to rule Babylon as regent (Daniel 5:30).

Being the descendants of Esau, the Edomites and the Israelites were relatives. But in 586 BC, when the Babylonians conquered Judah, Obadiah 1:10-14 records that the Edomites joined in the slaughter and behaved as though they were in league with the Babylonians. They entered the city, joined in the looting, and slaughtered those who were trying to escape. Because of this great act of betrayal, the bible contains more prophecies of condemnation and judgment against Edom than against any other nation (Psalm 137:7-9, Isaiah 11:14, 21:11-12, 34:5-17, 63:1-6, Jeremiah 9:25-26, 25:17-26, 49:7-12, Lamentations 4:21-22, Ezekiel 25:12-14, 35:1-15, Joel 3:19, Amos 1:11-12, 9:11-12, Obadiah, Malachi 1:4).

In verse 8 the Jewish exiles in Ancient Babylon refer to Edom's coming destruction. This is probably based on the prophecy of Jeremiah 49 which was given before the exile. Jeremiah 49:18 prophesies that Edom will be destroyed like Sodom and Gomorrah, and that no-one will live there afterwards. Revelation 18:2 links the destruction of Mystery Babylon to the prophecy in Isaiah 34 of Edom's judgment. So it is reasonable to understand that verse 8 refers to the still-future destruction of Edom as part of Mystery Babylon.

As well as Revelation 17-18, the other key passage that links Edom to Mystery Babylon is Isaiah 21.
Places: Edom, Daughter of Babylon, Mystery Babylon
Tags: Mystery Babylon, Fall of Babylon, Destruction of Edom, Daughter of Babylon, Edom as Daughter of Babylon
1 By the rivers of Babylon we sit down and weep when we remember Zion.
2 On the poplars in her midst we hang our harps,
3 for there our captors ask us to compose songs; those who mock us demand that we be happy, saying: “Sing for us a song about Zion!”
4 How can we sing a song to the Lord in a foreign land?
5 If I forget you, O Jerusalem, may my right hand be crippled!
6 May my tongue stick to the roof of my mouth, if I do not remember you, and do not give Jerusalem priority over whatever gives me the most joy.
7 Remember, O Lord, what the Edomites did on the day Jerusalem fell. They said, “Tear it down, tear it down, right to its very foundation!”
8 O daughter Babylon, soon to be devastated! How blessed will be the one who repays you for what you dished out to us!
9 How blessed will be the one who grabs your babies and smashes them on a rock!