The ancestors of modern cyanobacteria invented O(2)-generating photosynthesis some 3.6 billion years ago. The conversion of water and CO(2) into energy-rich sugars and O(2) slowly transformed the planet, eventually creating the biosphere as we know it today. Eukaryotes didn't invent photosynthesis; they co-opted it from prokaryotes by engulfing and stably integrating a photoautotrophic prokaryote in a process known as primary endosymbiosis. After approximately a billion of years of coevolution, the eukaryotic host and its endosymbiont have achieved an extraordinary level of integration and have spawned a bewildering array of primary producers that now underpin life on land and in the water. No partnership has been more important to life on earth. Secondary endosymbioses have created additional autotrophic eukaryotic lineages that include key organisms in the marine environment. Some of these organisms have subsequently reverted to heterotrophic lifestyles, becoming significant pathogens, microscopic predators, and consumers. We review the origins, integration, and functions of the different plastid types with special emphasis on their biochemical abilities, transfer of genes to the host, and the back supply of proteins to the endosymbiont.