system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Why do we experience dry-heaving when we smell very bad smells?
gpt
Usually if an animal was to encounter something which smelled very bad it was also likely harmful for them to ingest it. Throwing up what they ingested was likely to prevent them from experiencing even worse effects if they tried to digest whatever foul thing they ate.

Instincts like this address animals being incredibly stupid. "Oh, smells like shit... better eat it anyway!" The reflex would fix what they weren't smart enough to avoid. This is also why smelling people's vomit tends to make other people throw up: If one member of the group got sick from something they ate then probably others ate the same thing and need to purge it too.