For decades, school textbooks have explained that oxygen on Earth is mainly produced through photosynthesis, a process that depends on sunlight. Plant.