The oxidation of hydrogen sulfide to sulfate, a different sulfur compound, provides bacteria living around the vents with the energy necessary to produce organic matter, pretty much in the same way as the sun provides plants with the energy to perform photosynthesis and grow.