He sent an angel to stop the way. Balaam's ass saw the angel, but Balaam did not. It would appear Balaam was too focused on his notoriety and riches he was to receive from Balak to notice anything. Three times the donkey avoided the angel, and Balaam was angry with the donkey and beat it with a rod. The Lord unstopped the donkey's mouth, and it talked to Balaam, "What have I done unto thee, that thou hast smitten me these three times?" Balaam responded "Because thou hast mocked me: I would there were a sword in mine hand, for now would I kill thee." It wasn't until after the donkey responded, explaining itself, that Balaam's eyes were open and he saw the angel. It seems Balaam was so intent on having his own way, he missed seeing the angel and abused his donkey. How hard is it to submit our will to the sill of the Lord. Consider that the Lord submitted his will to the Father's. Abraham was willing to sacrifice Isaac as per the will of the Lord. Mary said, "Be it unto me according to thy word." Nephi said, "I will go and do the things which the Lord hath commanded." The sons of Helamen were blessed because they obeyed with "esactness."
How much more blessed are we if we follow the will of Lore, rather than insisting he sanctify what we want to do.