Fun Fact about Donkeys: I was told this at The Donkey Sanctuary of Canada. It makes sense.
So why do donkey's fight predators? They look like small horses (kinda), and horse just run away.
It has to do with their ancestry. Contrasting horses and donkeys, horses originated in the plains of Eurasia. Food was abundant, so when there were predators, they could simply run away. They could always find food elsewhere. Donkeys, on the other hand, originated in the desert. So when they found an oasis and a predator arrived, they could not just run away. They might not find another food source. So they stayed and fought.