I’ve raised quite a few donkeys. Nearly had my head kicked off by one I was unfamiliar with as well. They are way smarter than horses and their crossed offspring, mules. Had one jack that took delight in sneaking up on sleeping dogs, nipping them and stomping his forefeet around them as they woke trying to get away. The jack could have killed them easily but just thought it was funny. Yes, they are that smart. I suspect the donkeys mentioned in the article had an ongoing fued with this guy. They don’t forget things like being pelted with rocks or sticks.
I’ve read that in order to protect sheep or goats from wolves or other predators, one introduces a couple of donkeys and llamas. They apparently tear up wolves and coyotes quite easily.