Biogas is produced when organic matter biodegrades under anaerobic conditions (that is, in the absence of oxygen). This process produces a mixture of gases – primarily methane, with some carbon dioxide and tiny portions of other gases such as hydrogen sulphide.