H2S gas, also known as hydrogen sulfide, is created by certain bacteria through a process called sulfate reduction.
During sulfate reduction, these bacteria use sulfate (SO42-) as an electron acceptor and organic compounds as electron donors. The organic compounds are broken down by the bacteria, and the electrons that are released in this process reduce sulfate to hydrogen sulfide (H2S).
The reaction for how H2S is created can be written as follows:
SO42- + organic compounds + H+ → H2S + CO2 + H2O
This process of hydrogen sulfide production occurs in various anaerobic environments, such as wastewater treatment plants, sewage systems, swamps, and septic systems. It is also responsible for the characteristic odor of rotten eggs in these environments.