Now THAT is a good question. When you sleep, it is just the same as boogers actually. The eye secretes tears while you sleep, and it seeps through the crakcs of your eyelids, and as you sleep, dust and other particle collect in the ducts where the liquid collects.