Biogas is produced when plants and animals die, then degrade and decompose.
Cows and other animals produce sewage from their droppings, which again decomposes and produces gas. This gas contains a great deal of methane which has a very strong odour.
We can use this gas to cook with and that's biogas.