Because horses are prey animals, they don't like sleeping on the ground. Due to their straight backs, horses can't get up quickly. If a predator approaches a sleeping horse while it's lying down, the horse may not be able to get up fast enough to escape.

Thanks to specialized legs, however, a horse can lock its knees and fall asleep standing up — without falling over! A horse's fear of predators also leads it to do most of its sleeping during the day.

Just because a horse can fall asleep standing up doesn't mean it never lies down, though. Sometimes horses will take naps lying down during the day. This gives them a chance to rest their legs.

More Info: wonderopolis.org