This psalm is a prayer for God to deliver Israel and pay back her enemies seven times over for their crimes and insults against God and his people in Jerusalem.
This psalm is Israel's prayer for deliverance after Jerusalem has been reduced to rubble and the temple defiled. Fulfilment may be seen at several times in Israel's history including:

1) Babylon's destruction of Jerusalem and its first temple in 586 BC
2) The sacking of Jerusalem by Antiochus Epiphanes in 168 BC, and defilement of the temple when he set up a statue of Zeus and ordered the Jews to sacrifice pigs to it. This statue was the fulfilment of the 'abomination that causes desolation' in the prophecy of Daniel 11:31.
3) The destruction of Jerusalem and its second temple by the Romans in AD 70.

It is also reasonable to understand this as a prophecy of the end-time invasion of Jerusalem by the Antichrist, when the Antichrist will once again set up an image called the 'abomination that causes desolation', as prophesied in Daniel 9:27. Jesus spoke of this as a yet-future event in Matthew 24:15, and urged us to understand it.

The petition of verse 12, "Pay back into the laps of our neighbours seven times the reproach they have hurled at you, O Lord" (NIV), is based on Leviticus 26:18, according to which God promised to make Israel pay seven times over for her sins if she rejected God. So the psalmist asks God to use the same yardstick against Israel's enemies. Ultimately this prayer will be answered when Jesus defeats and punishes Israel's enemies at Armageddon. At that time, as in verse 10, Jesus will avenge among the nations the shed blood of his servants.
Places: Jerusalem, Temple
Symbols: Abomination that causes desolation
Tags: Antichrist invades Jerusalem, Fall of Jerusalem, Abomination that causes desolation, Pay back seven times over
1 A psalm of Asaph. O God, foreigners have invaded your chosen land; they have polluted your holy temple and turned Jerusalem into a heap of ruins.
2 They have given the corpses of your servants to the birds of the sky; the flesh of your loyal followers to the beasts of the earth.
3 They have made their blood flow like water all around Jerusalem, and there is no one to bury them.
4 We have become an object of disdain to our neighbors; those who live on our borders taunt and insult us.
5 How long will this go on, O Lord? Will you stay angry forever? How long will your rage burn like fire?
6 Pour out your anger on the nations that do not acknowledge you, on the kingdoms that do not pray to you!
7 For they have devoured Jacob and destroyed his home.
8 Do not hold us accountable for the sins of earlier generations! Quickly send your compassion our way, for we are in serious trouble!
9 Help us, O God, our deliverer! For the sake of your glorious reputation, rescue us! Forgive our sins for the sake of your reputation!
10 Why should the nations say, “Where is their God?” Before our very eyes may the shed blood of your servants be avenged among the nations!
11 Listen to the painful cries of the prisoners! Use your great strength to set free those condemned to die!
12 Pay back our neighbors in full! May they be insulted the same way they insulted you, O Lord!
13 Then we, your people, the sheep of your pasture, will continually thank you. We will tell coming generations of your praiseworthy acts.