Biogas is primarily composed of methane and carbon dioxide, with methane being the main combustible component responsible for its energy value.