It all depends on digestion

Biogas is produced in biogas plants by the biological degradation of biomass. Most inputs are farming substrates such as liquid and solid manure or energy crops (corn, rye, sugar beet, etc.), or organic waste, e.g., cut grass, waste food and by-products from food processing.

Bacteria start a fermentation process by which biogas is produced in digesters – so called fermenters – under airtight cover. The bacteria are the same as those found in the digestive tract of cows.

If you want more, see at: Biogas für Einsteiger (YouTube, 2.29 min.)

Available for downloading: Chart illustrating the production of biogas – from the field into the power grid –> Übersicht_Biogaserzeugung.pdf