The man whom the Moabites and Midianites believed to be Moses' peer was none other than Laban, Israel's arch-enemy, who in olden days had wanted to root out entirely Jacob and all his family,  and who had later on incited Pharaoh and Amalek against the people of Israel to bring about their destruction.  Hence, too, the name Balaam, "Devourer of Nations," for he was determined to devour the nation of Israel.  Just at this time Balaam was at the zenith of his power, for his curse had brought upon the Moabites their defeat at the hands of Sihon, and his prophecy that his compatriot Balak should wear the royal crown had just been fulfilled, so that all the kings sent ambassadors to seek advice from him. He had gradually developed from an interpreter of dreams to a sorcerer, and had not attained the still greater dignity of prophet, thus even surpassing his father, who had indeed been prophet too, but not so notable a one as his son. 
God would permit the heathens to have no ground for exculpation, for saying in the future world, "Thou hadst kept us far from Thee." To them, as well as to Israel, he gave kings, sages, and prophets; but whereas the former showed themselves worthy of their high trust, the latter proved themselves unworthy of it. Both Solomon and Nebuchadnezzar were rulers over all the world: the former built the Temple and composed many hymns and prayers, the latter destroyed the Temple and cursed and blasphemed the Lord, saying, "I will ascend above the heights of the clouds; I will be like the Most High." Both David and Haman received great treasures from God, but the former employed them to secure a site for God's sanctuary, whereas the latter with his tried to destroy the whole nation. Moses was Israel's prophet, and Balaam was prophet of the heathens: but how great a contrast between these two! Moses exhorted his people to keep from sin, whereas Balaam counseled the nations to give up their moral course of life and to become addicted to lewdness. Balaam was also different from the Israelite prophet in his cruelty. They had such pity for the nations that misfortune among the heathens caused them suffering and sorrow, whereas Balaam was so cruel that he wanted to destroy an entire nation without any cause.
Balaam's course of life and his actions show convincingly why God withdrew from the heathen the gift of prophecy.  For Balaam was the last of the heathen prophets. Shem had been the first whom God had commissioned to communicate His words to the heathens. This was after the flood, when God said to Shem: 'Shem, had My Torah existed among the previous ten generations, I suppose I should not have destroyed the world by the flood. Go now, announce to the nations of the earth My revelations, ask them if they will not accept My Torah." Throughout four hundred years did Shem go about as a prophet, but the nations of the earth did not heed him. The prophets that labored after him among the heathens were Job and his four friends, Eliphaz, Zophar, Bildad, and Elihu, as well as Balaam, all of whom were descendants of Nahor, Abraham's brother, from his union with Milcah. In order that the heathens might not say, "Had we had a prophet like Moses, we should have received the Torah," God gave them Balaam as a prophet, who in no way was inferior to Moses either in wisdom or in the gift of prophecy. Moses was indeed the greatest prophet among the Israelites, but Balaam was his peer among the heathens. But although Moses excelled the heathen prophet in that God called him without any previous preparation, whereas the other could obtain Divine revelations only through sacrifices, still Balaam had one advantage over the Israelite prophet. Moses had to pray to God "to shew him His ways," whereas Balaam was the man who could declare of himself that he "knew the knowledge of the Most High." But because, in spite of his high prophetic dignity, Balaam had never done anything good or kind, but through his evil tongue had almost destroyed all the world, God vowed a vow to His people that He would never exchange them for any other people or nation, and that He would never permit them to dwell in any land other than Palestine.