This law is called Mendel's second law, or the Law of Independent Assortment.
The law is derived from observations of dihybrid crosses. A classic example involves seed shape and color in garden peas. The shape may be round (caused by a dominant allele, denoted by R) or wrinkled (recessive, r). The wrinkling is caused by a mutation preventing the formation of branches in starch molecules. The color of the seeds may be yellow (dominant, Y) or green (recessive, y). The green color results from a variant sequence in a gene; the seeds fail to develop normally.
Parentals are RRYY and rryy.
The F1 plants are RrYy.
The F2 plants show independent segregation of the alleles for the two characteristics, shape and color. A Punnett grid predicts a 9:3:3:1 ratio for the phenotypes round yellow, round green, wrinkled yellow, and wrinkled green.