H2S is generated both naturally and through anthropogenic activities. Naturally, it is released during the breakdown of organic matter by bacteria in anaerobic conditions, such as in swamps and sewers. Industrially, H2S is a byproduct in processes like petroleum refining, natural gas processing, and sewage treatment.