There is some debate on exactly how meiosis evolved. One theory holds that mitosis developed first in prokaryotes and then meiosis evolved in eukaryotes. If this is actually true, then the major evolutionary step that facilitated this evolution is sexual reproduction. The development of gametes and sexual reproduction necessitated the need for haploid daughter cells since two haploid gametes join during sexual reproduction to form a diploid zygote. Mitosis only produces diploid cells. Meiosis produces four haploid cells. Also, one of the major evolutionary advantages of sexual reproduction is the wider genomic diversity that it offers over asexual reproduction. Meiosis facilitates this through chromosomal recombination where each of the four haploid daughter cells produced has a different combination of the replicated chromosomes.