You yawn to equalize the pressure on your eardrums. This pressure change outside your eardrums unbalances other people's ear pressures, so they must yawn to even it out.

Why Yawning Is Contagious