And Balaam said to Balak, “Build for me here seven altars, and prepare for me here seven bulls and seven rams.” Balak did as Balaam had said. And Balak and Balaam offered on each altar a bull and a ram. And Balaam said to Balak, “Stand beside your burnt offering, and I will go. Perhaps the LORD will come to meet me, and whatever he shows me I will tell you.” And he went to a bare height, and God met Balaam. And Balaam said to him, “I have arranged the seven altars and I have offered on each altar a bull and a ram.” And the LORD put a word in Balaam’s mouth and said, “Return to Balak, and thus you shall speak.” And he returned to him, and behold, he and all the princes of Moab were standing beside his burnt offering. And Balaam took up his discourse and said,
“From Aram Balak has brought me, the king of Moab from the eastern mountains: ‘Come, curse Jacob for me, and come, denounce Israel!’ How can I curse whom God has not cursed? How can I denounce whom the LORD has not denounced? For from the top of the crags I see him, from the hills I behold him; behold, a people dwelling alone, and not counting itself among the nations! Who can count the dust of Jacob or number the fourth part of Israel? Let me die the death of the upright, and let my end be like his!”
And Balak said to Balaam, “What have you done to me? I took you to curse my enemies, and behold, you have done nothing but bless them.” And he answered and said, “Must I not take care to speak what the LORD puts in my mouth?”
And Balak said to him, “Please come with me to another place, from which you may see them. You shall see only a fraction of them and shall not see them all. Then curse them for me from there.” And he took him to the field of Zophim, to the top of Pisgah, and built seven altars and offered a bull and a ram on each altar. And he took him to the field of Zophim, to the top of Pisgah, and built seven altars and offered a bull and a ram on each altar. Balaam said to Balak, “Stand here beside your burnt offering, while I meet the LORD over there.” And the LORD met Balaam and put a word in his mouth and said, “Return to Balak, and thus shall you speak.” And he came to him, and behold, he was standing beside his burnt offering, and the princes of Moab with him. And Balak said to him, “What has the LORD spoken?” And Balaam took up his discourse and said,
“Rise, Balak, and hear; give ear to me, O son of Zippor: God is not man, that he should lie, 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? Behold, I received a command to bless: he has blessed, and I cannot revoke it. He has not beheld misfortune in Jacob, nor has he seen trouble in Israel. The LORD their God is with them, and the shout of a king is among them. God brings them out of Egypt and is for them like the horns of the wild ox. For there is no enchantment against Jacob, no divination against Israel; now it shall be said of Jacob and Israel, ‘What has God wrought!’ Behold, a people! As a lioness it rises up and as a lion it lifts itself; it does not lie down until it has devoured the prey and drunk the blood of the slain.”
And Balak said to Balaam, “Do not curse them at all, and do not bless them at all.” But Balaam answered Balak, “Did I not tell you, ‘All that the LORD says, that I must do’?” And Balak said to Balaam, “Come now, I will take you to another place. Perhaps it will please God that you may curse them for me from there.” So Balak took Balaam to the top of Peor, which overlooks the desert. And Balaam said to Balak, “Build for me here seven altars and prepare for me here seven bulls and seven rams.” And Balak did as Balaam had said, and offered a bull and a ram on each altar. (Numbers 23:1-30 ESV)
Balaam, despite his desire to receive a stipend from Balak, will not or cannot speak but what Yahweh tells him, so instead of cursing Israel he continues to bless them. Balak gets credit for continuing to try. One more attempt will be made.
Interestingly, in the process of blessing Israel, Balaam prophesies that God is not a man that he would lie or change His mind. This very clearly tells us that in passages where it is represented that Yahweh seems to change His mind, that is in fact not happening. Rather, Yahweh is spoken of anthropopathically, in psychological terms like a man, in order to communicate the effectiveness of human prayers or human repentance. But His mind is ever the same in all situations.
And God will never curse His people or allow them to be cursed. He identifies Himself with us. We are His people and He is our God. The curses of others will not and cannot materialize. We belong to Him.