The accepted (but incorrect) explanation for yawns, which also exist in fetuses and mammals, is that yawning is intended to cool the brain.
The liver, kidneys, and brain use over 50 percent of the body's energy at rest. (BMR) When we are exhausted, usually due to metabolic fatigue, often after a heavy meal (which burdens the metabolic system), the brain "downshifts" through a yawn or a series of yawns to free up required energy resources using the liver and kidneys.
As a liver cirrhosis patient, I yawn all the time, even in freezing weather, so the common argument that yawning is meant to cool the brain is not the correct and complete explanation.
The need to "lower the brain's gear" by yawning exists when the brain detects a situation with a metabolic overload while the brain is too busy with non-critical activities.
Yawning happens, especially when we are tired, often while feeling bored. The fact that yawning is a contagious phenomenon comes from a completely different explanation. We tend to imitate others to save valuable resources of the brain. If you see someone yawning and feel bored, you will probably imitate the action without activating a thought mechanism, an energy-saving mechanism.
- Energy is a critical resource in the living world! Nature is built to conserve vital energy. It was initially thought that yawning was intended to pump more oxygen into the lungs, but this theory was wrong. The explanation that yawning is intended to cool the brain indirectly is plausible, but the answer is incomplete and does not provide a broad view.
- Fatigue without physical effort is often metabolic fatigue, in which the liver and kidneys are under high loads. In such a situation, the supply of nutrients to the brain is impaired; therefore, when we are tired, we yawn. A heavy meal weighs on the liver and makes us yawn even in the middle of the day.
If the explanation that yawning is intended to cool the brain were the complete explanation, then when we have a high fever or if the weather is scorching, we would yawn endlessly. (which is not the case) Yawning usually lasts a few seconds and cannot cool the brain significantly. (As suggested initially.)