You can think of it as a form of evolutionary pattern recognition: over millions of years of evolution, natural selection hit upon the insight that the presence of hydrogen sulfide molecules in the air was a reasonably good predictor that microbial life-forms that could be dangerous if swallowed were nearby.

