The first thing I do when I wake up each morning is look at the long list of notifications that have silently accumulated on my phone as I slept. The second thing I do is wipe away the gunk that silently accumulated in the corner of my eyes over the course of the night. No matter what you call it – sleep, sand, eye boogers – you know the stuff I'm talking about. I've always wondered what it was made of and why it forms, so I went and found out.

It all begins with tears – or more precisely the tear film that coats our eyes. Mammalian eyes of the terrestrial variety, whether they're found on the faces of humans, dogs, hedgehogs, or elephants, are coated in a three-layered tear film that allows the eyes to function properly. (Tears work somewhat differently in marine mammals like dolphins and sea lions.)

Closest to the eye is the glycocalyx layer – a layer made mostly of mucus. It coats the cornea and attracts water, which allows for the even distribution of the second layer: the water-based tear solution. It might be just four micrometres thick – about as thick as a single strand of spider silk – but this layer is very important. It keeps our eyes lubricated and washes away potential infections. Finally, there is an outer layer composed of an oily substance called meibum, which is composed of lipids like fatty acids and cholesterol.