Horses really can sleep while standing.
Their legs contain a specialized system of tendons, ligaments, and joints often called the stay apparatus.
The legs can support weight with little effort
The stay apparatus allows parts of the limbs to stabilize mechanically.
The horse does not need to keep every muscle actively contracted just to avoid collapsing.
That lets it doze while remaining upright.
Why would standing sleep be useful?
Horses evolved as prey animals.
Standing provides a major escape advantage.
If danger appears, a standing horse can start moving immediately.
Getting a large body up from the ground takes more time.
Do horses ever lie down?
Yes.
Standing rest is not the entire story.
Horses generally need to lie down for periods of deeper sleep, especially REM sleep.
So a horse that literally never lies down may have a problem.
How is this different from bats?
Bats sleep upside down using a different anatomical trick.
Their feet lock around a perch, and hanging gives them a good launch into flight.
Horses use leg support to remain upright on the ground.
Can a horse fall over asleep?
Normally the support system prevents that during ordinary standing rest.
But illness, extreme fatigue, neurological problems, or other conditions can interfere with normal posture.
Why does the posture look uncomfortable to us?
Human knees and legs are not designed to lock into a low-effort standing rest position.
We project our own anatomy onto the horse.
The horse is not holding a standing pose all night through sheer determination.
Its legs have built-in support hardware.
And that’s the short explanation.
Related explanations: Why do bats sleep upside down?, Why do penguins huddle together?, and Why do animals have tails?