God gave Balak a way out of his dilemma, but he didn't take it. Instead, he showed that he lacked wisdom and sense and he chose the wrong way. And Balaam did not give him wise advice, but gave him foolish advice.
There is an object lesson in this that shows how Satan influences the "wise" of this world, the leaders, to make stupid decisions. Such leaders often choose the way of conflict and destruction when the way of peace and cooperation would bring better results not only for others but for themselves also.
When Israel was journeying out of the wilderness to the promised land, Balak, king of Moab, was afraid of them because they were so many and because they had come near to his land. So he hired Balaam, a kind of prophet, but not a righteous prophet (2 Peter 2:15-16), to curse Israel. But God had Balaam bless Israel, not curse Israel. You can read the whole story in Numbers chapters 22 through 24.
Balak became angry with Balaam for blessing Israel (Numbers 24:10-11). And though it isn't stated directly in the main account, Balaam apparently advised Balak to use Moabite women to seduce the men of Israel into worshipping Moab's false gods in an effort to make God angry with Israel, and Balak followed Balaam's advice (Numbers 31:15-16, Revelation 2:14, Numbers 25:1-3).
How stupid could they be? Did it never occur to Balak and Balaam that if their scheme succeeded and God became angry with Israel, would not God be ten times more angry with Balak and Balaam for causing this to happen in the first place, for leading Israel into sin?
Balak had a dilemma. He was afraid of Israel. But there was a better solution, one that God offered him, through Balaam, but Balak didn't understand it, or rejected it if he did understand it. Probably it went right over his head. He was so obsessed, under Satan's influence, with a spirit of harm and war and hatred that he couldn't see a simple, peaceful solution when it was put right in front of him.
Notice this part of the account: "Now when Balaam saw that it pleased the Lord to bless Israel, he did not go as at other times, to seek to use sorcery, but he set his face toward the wilderness. And Balaam raised his eyes, and saw Israel encamped according to their tribes; and the Spirit of God came upon him. Then he took up his oracle and said: 'The utterance of Balaam the son of Beor, the utterance of the man whose eyes are opened, the utterance of him who hears the words of God, who sees the vision of the Almighty, who falls down, with eyes wide open: How lovely are your tents, O Jacob! Your dwellings, O Israel! Like valleys that stretch out, like gardens by the riverside, like aloes planted by the Lord, like cedars beside the waters. He shall pour water from his buckets, and his seed shall be in many waters. His king shall be higher than Agag, and his kingdom shall be exalted. God brings him out of Egypt; He has strength like a wild ox; He shall consume the nations, his enemies: He shall break their bones and pierce them with his arrows. He bows down, he lies down as a lion; and as a lion, who shall rouse him? Blessed is he who blesses you, and cursed is he who curses you" (Numbers 24:1-9).
Did you catch that last part? That was the solution to Balak's problem. Balaam, under inspiration of God, speaking God's words in this case, said of Israel, "Blessed is he who blesses you." Balak could have obtained a blessing from God if he took these words to heart.
God's word cannot be broken. God, through Balaam, promised a blessing to Balak if he blessed Israel. If he blessed Israel, he would have nothing to fear - God would have blessed Balak and Moab too. God promised that he who blesses Israel would be blessed. That promise was not made before in the Bible in exactly those terms, not to Abraham, not to Isaac, not to Jacob. This was something a little bit new, and Balak had an opportunity to take advantage of God's promise.
He could have said to Balaam, "Great. I will bless Israel so God will bless me. You have blessed Israel, and I will pay you your fee. Moreover, I will send ambassadors of peace to Israel. I will give them water and food and let them travel through my land on the way to their land." But he didn't do that. It was an obvious thing, but he didn't do it.
He already knew the promise was good. Why? Even though he didn't know God, he knew Balaam. He knew Balaam's word was good, and when Balaam pronounced a blessing, he could rely on it. He had previously sent messengers to Balaam saying, "Therefore please come at once, curse this people for me, for they are too mighty for me. Perhaps I shall be able to defeat them and drive them out of the land, for I know that he whom you bless is blessed, and he whom you curse is cursed" (Numbers 22:6). Balak knew that whoever Balaam blessed would be blessed. And Balaam just told him that he who blesses Israel would be blessed.
But Balak did not see it. Instead, "Then Balak’s anger was aroused against Balaam, and he struck his hands together; and Balak said to Balaam, 'I called you to curse my enemies, and look, you have bountifully blessed them these three times! Now therefore, flee to your place. I said I would greatly honor you, but in fact, the Lord has kept you back from honor' " (Numbers 24:10-11). Apparently Balaam didn't see the opportunity for Balak either and did not give him good advise about it.
This is an example of Satan's evil influence over Balak, over Balaam, and over the world. Balak and Balaam chose conflict and enmity instead of peace, even when peace would have been to their advantage.
They just didn't see it.