Once Photosystems I and II were sorted out, cyanobacteria took over the oceans, and because oxygen was their waste product, it became plentiful in Earth's atmosphere. As a result, many bacteria became aerobic — that is, they required (or at least tolerated) oxygen for their metabolic processes. About a billion years later, protozoa evolved as anaerobes (an organism that doesn't need oxygen for growth) scarfing up aerobic bacterial prey. At least once, the bacteria was not completely digested, but stayed within the cell and ended up helping the oxygen-intolerant anaerobic organism cope with the aerobic environment. These two organisms stuck together, and eventually the prey organism evolved into a cell organelle called mitochondria.
A similar scenario occurred with cyanobacteria around 1 billion years ago. In this case, an aerobic protozoan probably gobbled up a cyanobacterium, which ended up setting up shop inside its host, resulting in a small, membrane-bound organelle common to all plants: the chloroplasts.
As algae and multicellular plants evolved and benefited from plentiful CO2 and increasing oxygen in Earth's atmosphere, chloroplasts became the place where photosynthesis — Photosystem I, II and even more complicated stuff — went down in each cell. Just like mitochondria, they have their own DNA and spend their time busily harvesting light for the plant, creating the entire foundation for life on Earth.