I think our brain has a special cell (rather a unit of ) Nakalchi Bandar. These are mimicry cells. They may have evolved as a part of our learning process. How to learn, how to eat, how to hunt, how to light a fire etc. most learning is mimicry.
The same cells could be responsive for the yawn chain => you look at someone yawning & you start to yawn & the chain continues.
Similarly for laughing?