The clue to the meaning of Psalm 82 seems to me to be the question in verse 2: “How long will you judge unjustly, And show partiality to the wicked?”
I agree with Mark Smith about the mythological background here. The God of Israel addresses this question to the gods of the nations. Do you remember the introduction to the 1990s tv series Hercules?
The gods have been petty and cruel. Then Hercules arises to take a stand for mankind against the gods. Psalm 82 has a theme like that. The gods have been unjust. They have helped the evil-doers. But now Yahweh, the warrior God of Israel stands against them and for us.
How long? How long will the gods disrespect good people and show favor to evil-doers, asks verse 2. That kind of question has already been asked of God by the Asaph psalmists (Psalm 74:10 and 79:5). But now the blame is clearly assigned to the gods of the nations. They are judged for their cruelty to people:
“Defend the poor, and the fatherless.
Maintain the rights of the afflicted and the needy.
Rescue the weak and destitute.
Snatch them from the hand of the wicked.”
They don’t know, neither do they understand.
They walk back and forth in darkness.
All the foundations of the earth are unstable.
Goulder in his Psalms of Asaph and the Pentateuch applies this to the time of the Assyrian crisis when the 722 BCE fall of Samaria was at hand. “A decade of repeated invasions, battles, sieges, and devastations had left the smiling country in ruins. The men folk dead, enslaved or under arms, the land is often untilled, or its harvests stolen or burned; starving orphans and pathetic old women scavenge for what they may” (p., 163). At this point the psalmist felt God’s patience must be worn out. Even the foundations of the earth are unstable. The brutality of the gods threatens to return the world to its pre-creation chaos and disorder.
What Israel faced was not understood as social injustice, but ontological injustice imposed by foreign gods. There needed to be a regime change in the pantheon.
So was Israel really polytheistic? Had they been evolving from belief in many gods to intolerant belief in the hegemony of just one God?
Here is what I think, for what it is worth: monotheism is an abstract, metaphysical concept that doesn’t really apply to ancient Israel. Many in Israel accommodated themselves to foreign gods and even rationalized idol worship and sacrifice to those gods. But there was a very old tradition that one god, Yahweh, had given them the land. Before the time of Second Isaiah, the prophets in that tradition did not deny the existence of other gods. They opposed the worship of those gods in Israel, and they opposed idol worship, even if the idol was supposed to represent Yahweh. The claim in Judges 11:24 that Chemesh had given Moab its land, while Yahweh had given Israel its land, was not considered an unorthodox claim.
I question the use of the concept of the evolution of an intolerant monotheism from a tolerant polytheism. Mark Smith promotes that concept and Robert Wright does even more radically in a book entitled The Evolution of God.
The belief that worship of other gods by Israelites was an act of disloyalty must go back at least to the overthrow of Queen Athaliah in Judah described in 2 Kings 11:4 ff. The priest, Jehoiada., recruited the “people of the land” and others to do away with Athaliah and restore a commitment to the covenant with Yahweh. Groups like the Levites and the “people of the land” must have kept alive the old tradition of an exclusive covenant with Yahweh. This has to go back beyond the coup against Athaliah in about 825 BCE.
So, reasserting faith after looking at the theories, I appreciate Psalm 82 for using popular mythology to make a powerful statement of the supremacy of Israel’s God.