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.
This is a very interesting question, but I'm afraid that the answer as to why we yawn is still quite a mystery to science. Actually, there are several aspects of human/vertebrate behavior that remain quite mysterious - such as yawning, shedding tears while crying, sleeping, etc. Scientists have simply failed to provide satisfying reasons for these behaviors to exist - though there are of course many theories - all unproven.
So let us consider yawning. When do we yawn? Generally when it is very late and we are tired, but also in the morning when we get up. We also have other associated behaviors - such as stretching, having "heavy" eyelids, etc. So why do we do these things? I will offer several popular theories and then present evidence that suggests that each of these ideas is probably false. Then I will present my own theory and propose several simple experiments to test these ideas. (Read entire article)