From Discovery News:
If your head is overheated, there’s a good chance you’ll yawn soon, according to a new study that found the primary purpose of yawning is to control brain temperature.
The finding solves several mysteries about yawning, such as why it’s most commonly done just before and after sleeping, why certain diseases lead to excessive yawning, and why breathing through the nose and cooling off the forehead often stop yawning.
The key yawn instigator appears to be brain temperature.
“Brains are like computers,” Andrew Gallup, a researcher in the Department of Biology at Binghamton University who led the study, told Discovery News. “They operate most efficiently when cool, and physical adaptations have evolved to allow maximum cooling of the brain.”