We humans may need our eight hours of sleep a night to keep our brains functioning, but that's not the only duration, or reason, why animals sleep. Bats sleep for 20 hours out of the day while giraffes snooze for less than two hours a day. And while humans completely conk out, oblivious to the world, other animals like some whales and seals, shut off only portions of their brain at a time, keeping the other half active for such important functions as staying at the surface for breathing.

Why is there such variety in the animal kingdom? It's something scientists have been pondering for a long time.

Is there some universal factor for why animals sleep? Paul Shaw, PhD, certainly thinks so. "[S]leep is costly. When an animal sleeps it's not taking care of its young, it's not protecting itself, it's not eating, it's not procreating," he said in a 2006 article in the American Psychological Association. But it seems that sleep may serve different functions for different animals, which is why there are such wildly different sleep durations and ways of sleeping, depending on the many factors at play for a species.

Some female fruit flies only sleep about 70 minutes a day and live just as long as other files even if they're deprived of sleep. Some migratory birds can adjust how much sleep they need depending on the season, getting by with much less sleep during migration season than at other times of the year.

Meanwhile, carnivores have the luxury of sleeping more hours in the day than herbivores, which are generally prey species constantly on the lookout for carnivores. And most mammal infants sleep much of the time during their first few weeks and months of life, yet baby dolphins don't sleep at all their first few months. This shows that while sleep is important for cognitive function for some species, that may not be why sleep is vital to other species.

The variety of ways animals sleep is staggering, and researchers are only beginning to make a dent in understanding the inner workings and purpose of sleep among different species.

Indeed, sleep can be a bit mysterious.

Editor's note: This article has been updated since it was originally published in May 2015.

Jaymi Heimbuch ( @jaymiheimbuch ) focuses on wildlife conservation and animal news from her home base in San Francisco.

Surprising facts about how animals sleep
Sea otters hold hands so they don't float away during naps, and baby dolphins don't sleep at all for the first months of life.