Balaam is the unsung prophet of the Torah. In the course of his appearance in the parasha Balak, Baalam transforms the perception of the Israelites from dreaded outsiders who are to be cursed, to a powerful people who enjoy HaShem’s approval.
Baalam’s contribution at first seems highly unlikely. He has been hired, after all, by Balak, King of the Moabites, to curse the Israelites and he doesn’t refuse the job per se. Baalam does say, when approached by the elders of MIdian, that he awaits HaShem’s instruction.
HaShem, when told of the approach by these elders, tells Baalam not to curse the Israelites because they have been blessed. HaShem allows Baalam to travel with the elders if they invite him, but that he must do whatever HaShem commands.
When Ballam does go with the elders, HaShem mysteriously changes his mind. An angel of HaShem puts himself in the way. This causes the ass that Balaam is riding to bolt, and Balaam spends a great deal of time getting the recalcitrant animal to go where his master wants. On three different occasions Balaam beats the ass.
Then the animal talks back! In perhaps the only time in the Torah, a prophet is upstaged by a talking animal. And Baalam is caught in the middle of a fight between HaShem and Balak. What is he going to do?
If Balaam were anything like Jonah, he would try to flee. But unlike the later hapless prophet who finds himself dumped overboard and swallowed by a whale, Balaam stays the course. He will do as HaShem commands.
Three times Balak tells Balaam to build an altar and curse the Israelites. Three times Balaam follows through on the altars, but as for cursing, Balaam says he will only do what HaShem tells him to do.
By the third time Balaam is not only refusing to curse the Israelites, but is actually blessing them. They are to be the victors in the struggle with neighboring peoples. The transformation complete, Balaam leaves the scene, unheralded and unthanked.