God’s anger was kindled because he went; and the angel of Yahweh placed himself in the road as an adversary against him. Now he was riding on his donkey and his two servants were with him. Bible see other translations

“as an adversary.” If God had really wanted to kill Balaam then He could have, and the fact that He did not, and that the angel miraculously appeared to the donkey shows that God was just trying to impress upon Balaam the seriousness of the situation and the need to speak only what God told him to speak (cp. Num. 22:35).

Commentary for: Numbers 22:22