Wild horses, usually living in the vast desert grasslands, are sometimes not only the hunting targets of human beings, but also the delicious food of carnivores such as jackals. Unlike cattle and sheep, it can fight the enemy with its horns for a long time. The only way is to escape from the enemy. Jackals, wolves and other carnivores are nocturnal. They rest in bushes or caves hidden in soil and rocks during the day and come out to hunt at night. So in order to avoid the enemy quickly and timely, they dare not sleep on the spot at night. Even during the day, the horse just stands and takes a nap, keeping a high degree of vigilance to prevent accidents.
For domestic horses, although they don't have to worry about being hurt by natural enemies and humans like wild horses, they are also domesticated by wild horses, so they have always kept the habit of sleeping standing by wild horses. Not only horses but also donkeys have the habit of sleeping standing up. The reason may be that their ancestors lived in a very similar environment to wild horses.