When Balak sends messengers to Bilam, he sends them פתורה אשר על הנהר... “To Pethor, which is by the river” (22:5). Rashi comments that Pethor is Aramaic for a moneychanger, so just as people bring their money to a moneychanger, so too all of the kings sent requests to Bilam for occult services. Targum Yonatan says that the word Pethor means to interpret. Bilaam started out interpreting dreams and then went on to becoming a magician and then a prophet.
Another explanation could be that Pethor, located on the shores of the Euphrates, was one of the centers of sorcery in the Mesopotamia. Black arts were known and practiced there. Therefore Balak sent messengers to Pethor to find Bilaam.
Rav Hirsch teaches that there are contradictory aspects to Bilaam’s personality. Bilaam was not a friend of Bnai Yisrael. He belongs in the group of people like Malchitzedek and Yitro, who recognize the truth of monotheism. Bilam recognized Hashem. However, despite this recognition, he did not add the qualities of morality and fine character to his personality to this recognition. Even with the knowledge that there is one true God, Bilaam went and attempted to curse Bnai Yisrael. Bilam acknowledged Hashem but he did not remove himself from idol worship nor did he follow Hashem’s commands.
Rabbi Elie Munk, in his book The Call of the Torah, says that Bilaam serves as an example of the need to express the knowledge of Hashem through the Mitzvot, so that, unlike with Bilaam, the recognition of Hashem can act effectively on one’s character.
Bilaam teaches us that it is not enough just to recognize God and know that He is there. Rather one should strive to perform Mitzvot. Through these Mitzvot, we can serve Hashem in a better way than the prophet Bilaam.