Horses have long, flowing manes. The colder the climate a breed is from, the thicker the mane tends to be. Donkeys and zebras have short, upright manes.
So, however, do true wild horses.
There are several theories as to why horses have such long, flowing manes, and the truth is probably a combination:
1. For fly protection. And it's true that a long forelock can discourage flies from landing on a horse's ears.
2. For extra warmth around the vulnerable neck and head. Northern European ponies often have manes so thick you can't see their ears at all - and the ears do have a lot of blood vessels close to the skin through which the animal can lose heat. Manes definitely do add warmth - in hot climates, some people roach pony manes so they don't sweat up under them.
3. Because humans like them. It's entirely possible that long, flowing manes were created out of pure human vanity. Or even because a long mane is a handy "grab handle" when something goes wrong while riding.
This Icelandic mare's shaggy mane probably does help her be the only species of livestock that can live outside in an Icelandic winter.