Eye Boogers, eye junk, crusty eye, gunk, goop, crud, and sleepies. Everyone's got a name for them and everybody's got 'em. So what causes that stuff to collect in the corners of your eye?
There's a special little organ around your eye called the plica semilunaris (sounds like a newly discovered star). This organ was thought to be useless, but lo and behold - it serves a special purpose after all.
It's the crust factory. It secretes a sticky fluid that collects any dust or pollen that has migrated into your eye. All those foreign bits are surrounded by this sticky stuff, so your cornea doesn't get scratched. This little organ "escorts" that garbage out of your eye just like a security guard.
But why do we wake up with them? During the day, your windshield washer eyelashes and tears do the job. When you're asleep, they take a break too.