In recent years, an accumulation of research has made very clear how important getting enough sleep is for human health. There’s a wider biological corollary to this — sleep seems to be pretty much universal in animals. For all its importance though, it’s still not 100% clear what sleep is actually for.
In vertebrates like humans, the mystery is compounded by the fact that there are two types of sleep: a more quiescent slow-wave type, as well as a more active REM (rapid-eye-movement) type of sleep. Most other animals appear to have only a quiescent phase.