It seems foolish to us today, but the territorial dominance of deities was not an insignificant part of life in the days of Moses. The theme wends its way well past him, too. The Assyrians tell Hezekiah that Yahweh cannot save them from the power of their empire:
Has any of the gods of the nations ever delivered his land out of the hand of the king of Assyria? Where are the gods of Hamath and Arpad? Where are the gods of Sepharvaim, Hena, and Ivvah? Have they delivered Samaria out of my hand? Who among all the gods of the lands have delivered their lands out of my hand, that the LORD should deliver Jerusalem out of my hand? (2Ki 18.33–35)This is just one of many examples from the OT. We might also consider the ten plagues in Egypt, in which God executes judgment not simply on the nation, but on the gods they worship. We might also point to the Philistines during the time of Eli: they capture the ark and assert Dagon's dominance over the Israelites, but it is their god who bows to Yahweh.
The same sort of thing seems to happen in Numbers when Balak calls Balaam to curse the Israelites. After the first blessing, Balak removes Balaam to another place, reasoning that God might be willing to curse the people there. He does the same after the second blessing.
Maybe he was a slow learner, but maybe, too, he felt that the conditions weren't right because Balaam was appealing to the wrong deity. Perhaps the god of this hill wasn't the same as the god of that hill; or maybe the gods were simply afraid of the size of the Israelite army and therefore were unwilling to curse them. Balak's reasoning is not made clear to us here, but it seems entirely possible to me that this was why he moved around so much.
We might also take note of how God introduces himself to Balak in the second blessing:
God is not man, that he should lie,In a word, Balaam expects God to act like a man. Indeed, this is the characteristic of all idols: they are like us. They are capricious, influenced by our offerings and sacrifices (read: bribes), changing with the wind—and apparently the geography.
or a son of man, that he should change his mind.
Has he said, and will he not do it?
Or has he spoken, and will he not fulfill it? (Nu 23.19)
To this, Yahweh reveals himself as constant and faithful: he is not a man, that he should lie. He is not to be driven about to do what he has said he will not do. He has blessed Israel, and his blessing is irrevocable. He is not like the gods worshiped by these other nations: he is Yahweh.
There is much we might say about this disclosure, and the means God uses to distinguish himself from mere idols.
I think in the end it is most important, most telling, that this is precisely the way he deals with us in the person of his dear son. He does not change: he has blessed us, redeemed us, and taken the sorry lot of humanity that we are and promised to conform us to the image of Jesus Christ. For all of our moaning and groaning on the way, for our inconstancy and faithless hearts, for all that we complain against his providential care, he remains faithful to us.
The history of Israel should provide such an illustration. Our idols are perhaps different than theres, but we should be equally wary of assuming that we are held in the capricious care of a territorial deity.