The theories regarding why people yawn range from boredom to cooling the brain to helping the brain to stay more alert. Regardless of what causes yawning, it is widely accepted that yawning is contagious.
According to the Huffington Post, sleep researchers are stumped on how yawning relates to sleep, but acknowledge that it often occurs in response to fatigue.
According to BGR, research from the University of Vienna suggests yawning helps to cool the brain, thereby keeping a person more alert and less inclined to fall asleep in inappropriate or unsafe circumstances. The research shows that yawning occurs less frequently when the ambient temperature is very hot or cold, suggesting that the act of yawning is indeed related to temperature.
Psychology Today reports that research has shown that yawning is tied to boredom and the power of suggestion, with most people yawning in reaction to seeing another person yawn. The paraventricular nucleus portion of the brain's hypothalamus emits a signal that causes a human being to yawn. This section of the brain also generates a hormone that increases significantly when a person is asleep and just before he awakes. Researchers say this may explain why most people yawn shortly after getting out of bed each morning.