Balak was a good strategist and tactician. He saw that the Israelites had Hashem on their side and thus had what he perceived to be a distinct spiritual advantage. He considered that might alone wasn’t going to do anything so he decided he would level the playing field.
He sent for this wizard he knew from his days in Mesopotamia. He knew that the sorcerer or prophet (depending on your point of view) Bala’am was the man for the job. Bala’am had studied some ancient texts (some thought he was one of three of the Pharaoh’s advisers in Egypt) and knew what time of the day G-d was “angry”, and judged people. Bala’am would then curse people at that specific time since people would be spiritually vulnerable.
Others give Bala’am more validity and refer to him as a prophet. They say that G-d gave all the 70 nations a prophet so no one people could complain that it wasn’t fair that Israel had a spiritual advantage by being so close to Hashem. So as Bala’am was traveling to Balak to negotiate, G-d intervened. He told him that He (G-d) would put the words in his mouth of what he should say about the Israelites.
G-d did this by sending an angel to block his path. This angel was standing in his way and had sword drawn. The Hebrew states that he encountered an obstruction in his path or—you guessed it—a satan.
In the Middle Ages, parts of Judaic culture succumbed to superstition. There are references in the Talmud about not taking specific paths at certain times because demons were out and would possess you. There are references in the Zohar that state that you bring good or evil influence upon yourself by whether you do good or evil. Demons are part of the latter choice.
So since the text in the Torah describes an angel blocking Bala’am’s path, and the Hebrew word to describe it was “satan”, then that angel was Satan. And therefore arose up a whole discussion of this antagonizing angel. Yes, it was Satan who disguised himself as a snake to test Adam and Eve in the Garden of Eden. And it is Satan that will tempt you to see how strong your integrity is. And it is Satan that will be G-d’s prosecuting attorney on the Day of Judgement.
As other religions and cultures arose out of Judaism, Satan took on a more distinct evil persona. He was now a “fallen” angel; his agenda was to destroy goodness and take over the world. Like an evil banker, his mission was to collect souls for an eternity in hell. Clearly, this mythology got out of control.
Contrary to the late, great Mr. Wilson’s rants, in Judaism, the devil doesn’t make you do anything. Thanks to Adam and Eve (with a possible assist from the serpent), we now have free will. We can decide whether to be good or evil. And let’s face it, it’s not so distinct. We make good and evil choices. Good people can do evil things every now and then, and bad people will do good things. There’s some of each in all of us.
On a spiritual level, you attract the forces that you put out. When you put out good vibes, good comes back to you. When you put out bad vibes, you become surrounded by evil. Of course, you can change, midstream even. If you see that your path is fraught with difficulty, consider what energy surrounds you.
Sometimes, of course, when we’re stressed, we want to do evil. We want that vengeance to alleviate the stress of these difficulties. That’s when it’s time to revert back to the good character.