According to the endosymbiotic theory, eukaryotic animal and plant cells arose from the fusion of a heterotrophic and anaerobic prokaryotic single cell with photosynthetic bacteria in a process called symbiosis.
Endosymbiotic Theory
In this theory, the phagocytosed bacteria would have become the mitochondria, responsible for cellular respiration, while the photosynthetic bacteria would have become the chloroplast, responsible for photosynthesis.
With the presence of these organelles, eukaryotic cells began to have greater energy efficiency and became more complex, developing organelles such as the endoplasmic reticulum and the Golgi complex. The appearance of oxygen in the atmosphere allowed the formation of the ozone layer, which allowed the emergence of multicellular organisms with cell walls, such as plants.