Sleep is often viewed as a vulnerable state that is incompatible with behaviours that nourish and propagate species. This has led to the hypothesis that sleep has survived because it fulfills some universal, but as yet unknown, vital function. I propose that sleep is best understood as a variant of dormant states seen throughout the plant and animal kingdoms and that it is itself highly adaptive because it optimizes the timing and duration of behaviour. Current evidence indicates that ecological variables are the main determinants of sleep duration and intensity across species.