And why do we yawn when we're not sleepy? Yawning is a curious behavior. People keep themselves up at night trying to come up with answers to this gaping mystery. Basically, three different solutions have been offered, but each one has its problems.
Solution #1: We yawn because we need extra oxygen. Our body senses we're running low on oxygen, and forces us to take an extra big gulp of air. Problem: Why don't we yawn after running a mile? Surely, if there were ever a time we needed more oxygen, that would be it.
Solution #2: Yawning is healthy for our lungs. Perhaps, every now and then, we get pockets and wrinkles in our lungs. A deep breath and a good stretch will smooth these wrinkles out. We know that yawning is very common among creatures with a backbone, including fish, crocodiles, and humans. All these creatures have a special fluid in their lungs, and yawning might spread this fluid out. Problem: This doesn't explain why yawning is "contagious."
Solution #3: Yawning is a form of social communication. A yawn is a sign we're sleepy. If lots of us start to yawn, then it's time for the whole group to go to bed. It's an unspoken agreement that we'll take a nap after Thanksgiving Dinner, and not sneak away to eat the leftover turkey. Problem: This solution doesn't tell us why yawning is so common among creatures with a backbone. What's a goldfish trying to tell us when it yawns? Also, we yawn when we get up in the morning, even after a good night's rest. Does this mean we should go back to bed? That's a nice thought, but it doesn't explain yawning.