One of the repeated motives of the Bible is the importance of properly interpreting the world about us. Wisdom means knowing the times and the seasons, and being able to understand what is going on; foolishness is not knowing how to interpret events. For instance, if we sin and find we are not immediately punished, the proper way to understand our situation is that God in his goodness is giving us time to repent (Rom 2.4). But we might just as likely understand that there is no God and that we are free to do as we please (Ps 94.3, 6-7).
I think the story of Balaam and the donkey (Num 22) is something like this. Balak is the king of Moab around the time of the Israelites' entry into Canaan. He sees them coming powerfully, having dealt severely with the Amorites, and fears for his own kingdom. So he sends an envoy for Balaam the seer (or prophet or whatever), asking that he curse the Israelites.
Balaam confers with the LORD and finds that the Israelites are blessed, and so cannot be cursed. Consequently he rejects the request and sends the envoy back. The king is upset by this and so sends a second envoy, and once more Balaam confers with the LORD. The LORD tells him to go along but only to say whatever the LORD gives him; so Balaam agrees to come back with this single proviso. God told him to go, but still the whole thing angered him (Num 22.20-2). Perhaps the LORD was upset that Balaam didn't receive the first message given and insisted by asking a second time. So he sends an angel before Balaam as he was riding to Balak on a donkey.
This is where things get interesting. The angel of the LORD has a sword; it's an angel of death. The donkey sees the angel, but Balaam does not. Consequently the donkey walks away from it, straying from the path. He does this three times, each time inconveniencing Balaam even more than the previous time: once he goes into a field (v. 23); another time he scrapes Balaam's foot against a wall on the side of the path (v. 25); and the third time he sits down under Balaam (v. 27). Each time the donkey changed its course, Balaam struck it. After three strikes, Balaam's out: God gives the ability to speak to the donkey, and he asks Balaam why he keeps being stricken (v. 28-30).
After the brief (and impassioned!) conversation with the donkey, Balaam's eyes are opened and he can see the angel of death, who warns him that if the donkey had not gone off course, he would have killed Balaam (v. 33). Balaam recognizes his sin (v. 34).
What can we learn from this? It seems to me here, too, the lesson is one of wisdom and proper interpretation of events. Balak saw the advance of the Israelites as a threat which might be displaced and defeated through black magic and curses. The truth was that the LORD was leading Israel into the land promised it through Abraham its father; not only that, the peoples of the land themselves were being punished for their sins (cf. Gen 15.16). Because of his inability to discern the signs of the times, he found himself cursing the people of God and opposing an unstoppable force.
Balaam was to the donkey as Balak was to Balaam: Balak wanted to curse Israel but the LORD told Balaam that they were blessed; Balaam goes along to Balak to assist him anyway, but the donkey saw the angel of the LORD was standing against them. The experience of having been blind to death's presence, standing just before your eyes but out of your sight, was deep and profound for Balaam. From that moment he realized that it was not the LORD's will to curse Israel, and that Balak was fighting a losing battle.
This may happen to us as well. We may insist on doing something or accomplishing this or that, whereas we find that those around us are less than disposed to participate or come along. Sometimes you'll find people giving the following advice: "Keep on! Follow your dream! Don't let the negativity of those around you detract you from your calling!" This certainly may apply in some cases, but in other cases those persons whom you think blind may be like Balaam's donkey: they see something ahead of you to which you yourself are blind. Their resistance may be God's way of letting you know that you are not on the right track.
This is why in everything we need wisdom. We need to ask God to open our eyes to the angels of death which might be standing before us, if our plans are not good -- even if they seem so to us.