Mendel's second law of inheritance states that alleles segregate independently during the formation of gametes. This means that during the formation of sex cells (sperm or egg cells), the two copies of a gene separate from each other randomly, so each gamete receives only one copy of the gene.
This random separation of alleles means that different traits are inherited independently of each other. For example, the inheritance of a gene for flower color does not affect the inheritance of a gene for plant height. This is why Mendel's second law is also called the law of independent assortment.