Contagious yawning and canine empathy

From the BBC:

Until recently it was thought that only humans and their primate cousins displayed contagious yawning, but now it’s been shown that dogs display the behaviour as well.

Yawning, although sometimes a response to extreme stress, is more often a sign of tiredness; but the reason for why yawning is catching is not fully understood.