Robert Alter, The Hebrew Bible: A Translation with Commentary (W.W. Norton & Co., 2019), 1:473.
The brilliant centerpiece among these citations of archaic poetry [e.g., Num. 21:27-30] is the oracles of Balaam (chapters 23 and 24), which follow the story of Balaam and his she-ass, tracing a cunning network of analogies to it. That story has often been characterized as a folktale, and there are no other instances of talking animals in the historical narratives of the Bible (the only other candidate, the serpent in the Garden story, belongs to the primeval and hence more mythological phase of biblical literature). Especially because, according to prevalent preconceptions, there is no humor in the Bible, it should be noted that this story is quite funny. The humor serves the purposes of a monotheistic satire of pagan notions of the professional seer with independent powers to curse or bless: Balaam the celebrated visionary cannot see the sword-wielding divine messenger who is plainly visible to his ass, and he is reduced to spluttering frustrating, finally engaging in an angry argument with his beast of burden. Balaam then plays the role of the ass whose eyes, and mouth, are opened by God vis-a-vis the thrice frustrated, and understandably fuming, Moabite king Balak, to whom Balaam’s previous role as imperceptive satiric butt is assigned in this second story.