The principal function of anaerobic digestion is to stabilize insoluble organic matter and to convert as much of these solids as possible to end products such as liquids and gases (including methane) while producing as little residual biomass as possible.