All the organisms can be divided into prokaryotes and eukaryotes. It is believed that prokaryotes are primitive organisms and all other organisms are descended from these prokaryotes.
This concept is explained by the help of endosymbiotic theory. This explains that present day eukaryotic cells are the result of evolution of simple prokaryotic cells.
This theory also explains the origin of eukaryotic organelles such as mitochondria and chloroplast. It explains the bacteria and cyanobacteria were ingested by phagotrophic cells. Those phagotrophic cells did not digest these bacteria and they lived within that cell in symbiosis. That symbiotic relationship leads to development of modern eukaryotic cells.