In Numbers 22:28 we encounter the second time in the Old Testament in which an animal is said to have spoken. And the LORD opened the mouth of the ass, and she said unto Balaam, What have I done unto thee, that thou hast smitten me these three times? And in 22:30 the ass said unto Balaam, Am not I thine ass, upon which thou hast ridden ever since I was thine unto this day? was I ever wont to do so unto thee? This event is summed up again in Deuteronomy 23:3.
The only other occasion in which an animal speaks, is of course, the serpent in Genesis 3:1, Now the serpent was more subtil than any beast of the field which the LORD God had made. And he said unto the woman, Yea, hath God said, Ye shall not eat of every tree of the garden?
What brought us to a talking donkey? Well, while the Israelites are wandering in the desert after their exodus from Egypt, King Balak of Moab (in modern day Jordan) makes several attempts to get Balaam to curse the Israelites. At this point, the Israelites have already killed the Amorites their King Sihon, as wells as the King of Bashan, Og. Balaam has a dream in which God tells him not to go meet Balak, and so Balaam send a message that he will only do what God commands, not what Balak wants. And yet, Balaam goes back on his word and ends up travelling to meet with Balaam.
This upsets God according to the text, and on the way to Moab Balaam’s donkey sees an angel standing in the way, with a sword drawn. The ass is afraid and veers aside, and frustrates Balaam, who has yet to see the angel. The ass is so disobedient that Balaam ends up beating it, and this is when the ass speaks back.
After the ass speaks, Balaam sees the angel, and all is revealed to him. He begs forgiveness, and the angel tells him to carry on with his travels. When he eventually reaches Moab and meets with Balak, he refuses to curse the Israelites.
But the story of Balaam does not end there. As summarized in The Revelation of Saint John 2:14, Balaam later returned to King Balak of Moab and explained that God told him not to curse the Israelites, but that Balaam could get them to curse themselves and therefore forfeit God’s protection.
Did the ass really speak like a human? Balaam was known as being a prophet, and it can be argued that such men were able to see what others were not. This direct channel to God might have produced such episodes that would not be available to an ordinary man or woman.