I learned this from National Geographic:
[Gary] Hack and co-author Andrew Gallup, of Princeton University, propose that yawning causes the walls of the maxillary sinus to expand and contract like a bellows, pumping air onto the brain, which lowers its temperature. Located in our cheekbones, the maxillary are the largest of four pairs of sinus cavities in the human head. Like a computer, the human brain is “exquisitely” sensitive to temperature and must stay cool to work efficiently . . . “