Endosymbiosis is a symbiotic relationship where one organism lives inside the cells of another, leading to the evolution of complex cells. This theory explains the origin of organelles like mitochondria and chloroplasts in eukaryotic cells, suggesting they were once free-living bacteria engulfed by ancestral host cells.