In humans and other animals, traits are passed on from parents to their offspring through DNA. When an egg is fertilized with sperm, the resulting offspring takes 50 percent of its DNA from each parent, and its traits are determined by which parts of its parents' DNA are passed on.
DNA consists of 52 pairs of chromosomes, and each parent passes off one half of each pair to the child. When the two halves of the DNA then join together, the resulting combination determines what specific traits the child has.
The traits that are expressed in the child are determined by dominant and recessive genes. If one or both parents pass on a dominant gene to the child, this is the gene that is expressed. However, if both parents pass on recessive genes, then the recessive gene is expressed.
The most obvious example of this is eye color, where the gene for brown eyes is dominant and the blue eye gene is recessive. If either parent passes on the brown eye gene, this is expressed in the child. People with blue eyes have two recessive genes, but people with brown eyes can have one dominant and one recessive gene. This is why a child can have blue eyes even if both parents have brown eyes. However, if both parents have blue eyes, the child can only have blue eyes.