Why do we fall asleep when bored?

Why do we have the tendency to fall asleep in the absence of motivating stimuli, i.e., when bored.