I am confused if eukaryotes have evolved from prokaryotes then how are they more closely related to archea?
Actually endosymbiotic theory (we should write "Endosymbiotic theory of origin of eukaryotic organelles") suggests a theory about only the eukaryotic organelles (mainly Plastid-family and Mitochondrion).
I'll divide my answer into 3 parts:
# Theory of archaeal origin of the eukaryotic host.
* 1. How Archaea (Archaebacteria) and Eukaryotes shared a closest common ancestor
# Endosymbiotic theory of origin of Eukaryotic cell organelle.
* 2. How mitochondria originated?
* 3. How plastid was originated?
Please keep in mind, in origin and evolution of eukaryotes, origin of the host cell (and the nuclear genome) is a different event; and origin of eukaryotic organelles mitochondria and plastid is another different event.
Theory of archaeal origin of eukaryotic host
1. How Archaebacteria (archaea) and precursor of eukaryotes evolved from their nearest common ancestor.
It has been established (First by Carl Woese, mainly based on her prolonged researches on rRNA sequences) (PDF) (REFERENCE-1
*) that Eukaryotic "host cell" (with the nuclear genome) shares the closest common ancestor with Archaebacteria, not the eubacteria.
Further reading: Relationships of Eukaryotes and archaea
Fig-1: Here the horizontal axis is the time axis.
(The small black balls here indicating many other possible extinct lineages (hypothetical, just todemonstrate how evolution works) )
On other hand, After the group bacteria (eubacteria) developed (better to say the precursor of bacteria further diversified, bacterial groups like proteobacteria and cyanobacteria developed. For bacterial phylogeny, see Wikipedia (image)
Now endosymbiotic theory tells that the origin of some eukaryotic organelles (at least Mitochondria and Plastid) were different and distant taxa from the eukaryotic cessls, and they came from outside and entered into the cell and formed symbiotic relation; and the endosymbionts gradually lost their free-living ability, were gradually became part of host cell. The peculiarity of this "Endosymbiosis" phenomenomenon in evolution is that; not only the "parent" taxa; but another "distant taxa" merge from side of the lineage. The concept is not only confusing but it was so shocking that when H. Margulis first proposed this hypothesis, the idea was rejected. Later on, genome-based research proven that the origin of mitochondria (and as we will see, plastids); were originated from mutualistic- symbiosis.
2. How mitochondria evolved in eukaryotes?
It has been suggested, the "precursor" of eukaryotes (which was descendant of closest-common ancestor with archaebacteria), the host cell, engulfed some aerobic eubacteria (perhaps allied to proteobacteria) those aerobic eubacteria gave rise to mitochondria. These derived protists were unable to photosynthesise. This endosymbiosis is very much similar to previous one.
So our evolutionary tree now look like
Fig 2b: Origin of mitochondria in eukaryotes, placed in evolutionary tree.
The white balls here represent living and contemporary groups.
(Just like previous picture the extinct groups are hypothetical and representitive; but the relative positionsof clades for proteobacteria and cyanonbacteria is actual, and taken from from Prescott's microbiology
(A common example of intracellular endosymbiosis will help us to understand the theory- we can still see such intracellular symbiosis in rhizobial bacteria colonising plant root/tissue; where we get both intracellular stage and culturable extracellular phase)
3. How Plastids evolved then?
From this group of protists, a certain group again engulfed a sort of eubacteria (allied to cyanobacteria). The cyanobacteria gave rise to plastids , and photosynthetic protists.
There are disputes about whether plastid and mitochondra evolved simultaneously or at an interval. According to T. Cavalier smith they originated simultaneously, but according to other newer sources like this and this , mitochondria appeared first.
It is not clear to me whether all eukaryotes (protists and their derivative higher plants, fungi and animals) had a plastid containing ancestor; or at least some non-photosynthetic protists came before origin of chloroplast (However just to mention, some of photosynthetic protists again evolved progeny with lacked photosynthetic ability due to retrogressive evolution (degradation) of plastid, such as Helicosporidium sp. etc )
So our final evolutionary tree looks like
* 1. : Molecular Biology, Author: R. F. Weaver, ED-5; Publisher: McGraw-Hill.
- : Cell Biology: Concepts and Experiments. Author: Gerald Karp, ED6, Publisher: Wiley.
** 3. : Prescott, Harley, Klein's Microbiology; Edited by Willey, Sherwood, Wolverton, Ed7, MackGraw-Hill.
Papers and Reviews
Bacterial evolution, Author : Woese; https://www.ncbi.nlm.nih.gov/pmc/articles/PMC373105/ ; PDF: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC373105/pdf/microrev00049-0051.pdf
Endosymbiotic theories for eukaryote origin. Authors: Martin, Garg, Zimroski; https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4571569/ , Pdf: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4571569/pdf/rstb20140330.pdf