Meiosis allows for genetic diversity and ensures genetic integrity is maintained in organisms. It produces gametes with half the number of chromosomes as somatic cells through two cell divisions. In the first division, homologous chromosomes separate and reduce ploidy level. Genetic recombination during prophase I and independent assortment during metaphase I introduce variation. The second division separates sister chromatids to form four haploid cells. Meiosis occurs in gonads and produces egg and sperm cells for sexual reproduction.