The passing of traits from parents to their offspring was probably one of the first scientific observations about the natural world, and may have been used to initiate domestication of livestock by encouraging particular traits to be more prevalent, and others to be less so. However, the mechanism by which this transmission occurs was not known until relatively recently, largely because the technology to observe and prove it didn't exist.
As with many other pseudo-scientific theories in human history, heredity was at times hypothesized to be due to a "life force" that was transmitted from parent to child, or some variation on this that suggested they were made from literally similar materials. This explained not only the obvious phylogenetic similarities, but afforded for some of the natural variations that were present as well. However, not being scientifically grounded, there was no understanding of the underlying genetic causes and relationships that produced the phenotypic effects.
Traits are passed from parent to offspring because the traits are the product of specific genes. Each parent has two copies of almost every gene, and those genes are each located on the two copies of every chromosome. During reproduction, these chromosomes are shuffled and then distributed into gametes (sperm and eggs) with a random combination of genes selected from the parent's available options.
So, out of the two copies of every gene, the child is ensured of receiving one. This may or may not be the same gene responsible for the dominant, visible trait in the parent, which accounts for how children can look more similar to one parent than the other, but usually resemble some combination of both, and only rarely do they resemble neither parent.