Biogas generators are large containers in which animal or plant waste is left to decay anaerobically. Importantly, there cannot be any oxygen in the container. If there is oxygen, the microorganisms will respire aerobically and won't produce as much methane. Once the biogas is removed from the tank, a sludgy material is left over, which contains a high density of useful minerals. This can be spread on fields like fertiliser.