You are correct in thinking that yawns are catching. Seeing, hearing or thinking about yawning can trigger the event, but there is little understanding of why it is contagious. A number of theories regarding the genesis of yawning have been presented over the years. Some evidence suggests that yawning is a means of communicating changing environmental or internal body conditions to others. If so, then its contagious nature is most likely a means of communication within groups of animals, possibly as a means to synchronize behavior. If this is the case, yawning in humans is most likely vestigial and an evolutionarily ancient mechanism that has lost its significance.