Balaam tries to do to the donkey what God was trying to do to him!
At this first appearance of the Angel of the Lord, the donkey changes course (good donkey!). Balaam tries to put her back on course—on his course. The donkey proves to be smarter than Balaam. When God stands against a person, the wisest course of action is to turn away and stop moving in the direction he is going because God has a sword and is ready to cut him off.
But Balaam is too blind. He does not see God at all in this, though the donkey does. The donkey knows that Balaam's path leads to destruction, and it wisely turns aside. Blind Balaam continues down the path of sin.
Do not enter the path of the wicked, and do not walk in the way of evil. Avoid it, do not travel on it; turn away from it and pass on. (Proverbs 4:14-15)
This is exactly what the donkey is trying to do, but what does Balaam do? He stupidly continues on because he could not see the danger. The donkey shows itself wiser than the "Wise and Powerful Balaam, the Renowned Enchanter"!
Richard T. Ritenbaugh
Balaam and the End-Time Church (Part 2)