The earliest photosynthesis was anoxygenic — it ran on raw materials like hydrogen sulfide and released no oxygen at all. The revolutionary upgrade, pioneered by cyanobacteria, was oxygenic photosynthesis: using sunlight to split ordinary water (H₂O) for the electrons needed to build sugars from carbon dioxide, and discarding oxygen (O₂) as the leftover.
The heart of the trick is a protein complex called Photosystem II, whose tiny manganese-and-calcium core — the oxygen-evolving complex — cycles through a precise five-step sequence, prying two water molecules apart one flash of light at a time. It's a feat of chemistry so elegant that engineers still can't reproduce it for artificial photosynthesis. Exactly when it arose is debated — anoxygenic photosynthesis was around by about 3.5 billion years ago, and estimates for the water-splitting version range widely.
The consequences would be the most planet-altering of any single biological innovation. Because water is everywhere, this new fuel source was effectively limitless — life could now grow almost without bound. The waste product, though, was about to poison the world.