The link above shows an easy to understand animation on the endosymbiont theory.The endosymbiont theory suggests that mitochondria and chloroplasts were once prokaryotic cells that were taken inside or invaded by a eukaryotic cell and lived inside it. Both cells benefited from this as the eukaryotic cell was provided with energy. This was due to the prokaryotic cell being able to carry out metabolic reactions such as respiration and photosynthesis. In turn the prokaryotic cell was provided with nutrients.
Some evidence to support this theory is that both chloroplast and mitochondria have characteristics in common wit prokaryotes such as: double membranes, circular DNA that is circular and not enclosed in a nucleus, 70s ribosomes, reproduces by binary fission and is similar in size to them.
Note: 70s refers to the rate of sedimentation of the ribosome in a centrifuge. The “s” is a unit of measurement known as the Svedberg unit.
References :
Reece, J., Lisa A. Urry, Michael L. Cain, Steven A. Wasserman, Peter V. Minorsky, Robert B. Jackson, 2010. Campbell Biology. 9th Edition Benjamin Cummings; 9th Ed.
Raven, P., George Johnson, Kenneth Mason, Jonathan Losos, Susan Singer, 2010.Biology. McGraw-Hill 9th Ed.