Why do our eyes close when we sleep? Is it to relax our eye muscles? How can it be explained from an evolutionary point of view?
Our eyelids close when we sleep probably for the obvious reason that it prevents the sclera and cornea from drying out, becoming accidentally scratched (such as blowing dust) and allowing oxygen diffusion from the inside of the eyelid (to the sclera and cornea). Fragile corneas are a requirement for our vision. Thick corneas are much less fragile but then attenuates more light.
1) blinking requires muscle movement which sort of defeats the purpose of resting
2) closed eyelids offer much better protection than periodic blinking
3) if you can blink, you have eyelids.
There's definitely something to the fact that eyes work better when they are closed periodically and don't work well when they are open constantly, but there is another angle to this topic.
I think its worth adding that not all animals sleep with their eyes closed.
This is because many animals only sleep with half of their brain at once. Ducks, some birds, aquatic mammals like whales dolphis and seals engage Unihemispheric sleep. In Unihemispheric sleep, half the brain is asleep and the other is awake. Not necessarily fully awake, but enough that one eye is open and watching for predators or other threats.
One might ask - didn't we all have predators and threats? Why don't we all sleep half the brain at a time? The answer is not clear, but it appears that unihemispheric sleep is not a trait that is maintained easily. Very few animals really have the ability. As such there must be some advantages physiologically to closing both eyes at once and experiencing total sleep.
Our eyes is extremely vital for our survival and is the most developed of the senses. Not only for us but for any higher animal. As everything from food gathering , hunting , protecting oneself and even basic movement is strongly linked to it the brain cannot so easily shut it off . For the animals whose brain did shut off their eyes easily ; probably were wiped out by predators or accident. It is most probable that natural selection chose to make eyelids which were easily retractable like a switch. Deactivating brain sensations is more complex and could not be developed through evolution due to the environmental pressures of predators or accident. Also it protected the delicate eyes while sleeping.