Frans de Waal answers
Empathy is increasingly regarded as present in all the mammals, and perhaps also birds. It probably goes back to parental care, with the need to pay attention to the emotions of one's offspring if they call in distress or because they are hungry. This origin may explain why mammalian females show more empathy than males, which also applies to our own species from a very young age onward. It may also explain why oxytocin (a hormone involved in maternal care and nursing) enhances empathy when administered by spraying it in the nostrils of both men and women.
Yawn contagion is by itself not exactly empathy (because it is not emotional) but it taps into the same basic mechanism of body synchronization that feeds empathy. Empathy starts with paying attention to the voice, body, and facial expressions of others and the tendency to match the emotional state of others (the way we mimic facial expressions: looking sad when someone tells a sad story, smiling to those who smile). Yawn contagion rests on the same mirroring mechanism. Finding this response in birds is important because it suggests that the same basic mirroring mechanism is found outside the mammals.
Empathy is being studied in rodents (mice, rats), dogs, elephants, monkeys, and apes. My own studies are on consolation behavior: how do primates react to the distress of others. Chimpanzees and bonobos, for example, embrace and kiss individuals who have recently lost a fight. Consolation responses show all the signs of well-developed empathy, and are also a prime measure of human empathy, for example in child studies. It means that the performer is affected by the emotional state of the other, and tries to ameliorate this state by providing calming contact.
We also study yawn contagion by showing chimpanzees videotaped yawns of members of their species. One of the main findings is that chimpanzees are more affected by the yawns of chimps that they know than the yawns of strangers. This effect of familiarity has also been found in humans, and relates to the fact that empathy is biased. Empathy is aroused most easily by individuals who are similar and familiar. We have trouble empathizing with outsiders, and for chimps it is the same.
Here is a photo (by me) of a juvenile chimpanzee embracing a screaming adult male, who has just lost a fight: