The Story of Bul‘aam
"Relate to them the story of the man to whom We sent Our signs, but he passed them by: so Satan followed him up, and he went astray." [Surah Al-A‘raaf 7:175].
Bul‘aam was a man who was a scholar from the children of Israel. He lived at the time of Moses (peace be upon him). "...To whom We sent Our signs..." [Surah Al-A‘raaf 7:175].
He was a person whose supplication was answered, because he knew the greatest Name, that is to say, he knew Allah's greatest Name, which if He were to be called upon with He will answer the supplication. He was a worshipper, scholar, and he was a person whose supplication was answered. His name was Bul‘aam ibn Baa‘ooraa’.
During Bul‘aam's lifetime, Moses (peace be upon him) and the children of Israel fought the military campaign during the battle for Beit Al-Maqdis (Jerusalem) to conquer it and take it from the hands of the pagans, the likes of the Cananites and the Amalekites.
So the enemies who Moses (peace be upon him) and the children of Israel were fighting against came to Bul‘aam, this scholar. They were afraid of the Muslims, they were afraid of Moses (peace be upon him).
The Pagans came to Bul‘aam requesting that he supplicate to Allah against Moses (peace be upon him) and against the Muslims. They requested this from him because his supplication was accepted. At first he rejected their request. Then they convinced him, perhaps through giving him some wealth. At this point he supplicated against Moses (peace be upon him). As a result of this transgression, Allah the Exalted disgraced him and removed the blessing from him.
"And had We willed, We would have raised him up thereby; but he inclined towards the earth and followed his lust. So the likeness of him is as the likeness of a dog; if you attack it it lolls its tongue out, or if you leave it, it lolls its tongue out. This is the parable who reject Our signs. So relate the story; perhaps they will reflect." [Surah Al-A‘raaf 7:176].