Most of us would gag if we ever see someone else vomiting. Why is our gag reflex triggered when we watch others in action?
Same question was answered on Columbia University Q&A.
Scientists believe that this response is the seat of empathy. Humans have been social animals for a long time in our evolutionary history, with survival-rooted interdependence — living and working together in groups. In the case of throwing up, it may have been true that people who were easily affected by another’s sickness were more likely to survive, as you guessed, because such a response would result in an individual releasing a harmful substance more quickly.
PS: This post is dedicated to my dear friend Bibin, who inspired me (back in 2007) to think about this question!