Explain the role of endosymbiosis in the development of eukaryotic cells.