sleep is very ancient. in the electroencephalographic sense we share it with all the primates and almost all the other mammals and birds: it may extend back as far as the reptiles.
there is some evidence that the two types of sleep, dreaming and dreamless, depend on the life-style of the animal, and that predators are statistically much more likely to dream than prey, which are in turn much more likely to experience dreamless sleep.
in dream sleep, the animal is powerfully immobilized and remarkably unresponsive to external stimuli. dreamless sleep is much shallower, and we have all witnessed cats or dogs cocking their ears to a sound when apparently fast asleep.
the fact that deep dream sleep is rare among pray today seems clearly to be a product of natural selection, and it makes sense that today, when sleep is highly evolved, the stupid animals are less frequently immobilized by deep sleep than the smart ones. but why should they sleep deeply at all? why should a state of such deep immobilization ever have evolved?
perhaps one useful hint about the original function of sleep is to be found in the fact that dolphins and whales and aquatic mammals in genera seem to sleep very little. there is, by and large, no place to hide in the ocean. could it be that, rather than increasing an animal's vulnerability, the university of florida and ray meddis of london university have suggested this to be the case.
it is conceivable that animals who are too stupid to be quite on their own initiative are, during periods of high risk, immobilized by the implacable arm of sleep. the point seems particularly clear for the young of predatory animals. this is an interesting notion and probably at least partly true.