Oxygen is used in the biogas production process to remove hydrogen sulfide (H2S) from the biogas. H2S is an unwanted component in biogas, as it can lead to equipment corrosion and damage.