King Balak, concerned about the huge number of Israelites (600,000 men plus women and children) that had migrated into land near Moab, attempted to hire the services of Balaam, a person with a reputation of employing curses or blessings.
Balaam became aware of God’s restraint on his actions and advised King Balak that he would only say what God told him; which resulted in pronouncing a blessing on the Israelites. Not just one time; but on three different occasions.
King Balak broke out in a rage against Balaam. Instead of the Israelites being cursed, they were blessed. Balaam continued with foretelling of the Israelites future prosperity and domination under the power of God. [Bible: Numbers 22:1 -24:25]