The endosymbiotic theory suggests that mitochondria were once free-living bacteria that were engulfed by another cell and evolved a symbiotic relationship with their host, eventually becoming integrated into the cell as an organelle.