You know how when you are in a group of people and somebody yawns, and then other people start yawning, and then you too feel the irresistible impulse to do likewise? Well, if there are dogs in the room, they too very likely will start yawning.
Scientists have studied the phenomenon of dogs yawning when people do. Furthermore, dogs don’t have to see someone yawn; they apparently hear humans yawning, which makes them want to yawn too. Researchers speculate whether this is evidence that dogs can actually empathize with human beings. See Dogs yawn when they hear people yawn, suggesting they empathize with humans – The Washington Post.
Now looking at this phenomenologically, I don’t recall empathy as a cause of my own yawning. I don’t notice someone yawning, feeling his boredom, and expressing that by yawning in an act of emotional solidarity. My theory is that in a group in which one person is bored or sleepy, the chances are good, since everyone is sharing the same experience, that other people are also feeling bored or sleepy. When a person yawns, that reduces the social pressure to repress the outward expression of what one feels, an inhibition that disintegrates completely when more and more people do it.