Mendel's work demonstrated that alleles assort independently in the production of gametes, or germ cells, ensuring variation in the next generation.