An endosymbiont is an organism that lives inside another organism (called the "host"); endosymbiont and host typically establish a strong basis of cooperation and cannot survive without each other. Common examples are nitrogen-fixing bacteria in the legume family and some algae inside reef corals.
Biologists widely believe that mitochondria and chloroplasts in eukaryotic cells are former bacterial endosymbionts: mitochondria originated from endosymbiotic proteobacteria, whereas chloroplasts evolved from endosymbiotic cyanobacteria. This accounts for why the mitochondrion possesses its own distinct genome and particular way of translating the genetic code.