Our understanding of genetics built up over about a hundred years, through the work of many scientists. In the mid-19th century Gregor Mendel carried out breeding experiments on plants. He observed that the inheritance of each characteristic is determined by units that are passed on to descendants unchanged.
Mendel's discovery was not recognised until after his death. At the time, scientists did not know about chromosomes or what happens during cell division, so they had no way to link his units to anything they could see. His ideas also did not fit the usual belief that characteristics blend together in offspring.
In the late 19th century the behaviour of chromosomes during cell division was observed. In the early 20th century scientists saw that chromosomes and Mendel's units behaved in similar ways. This led to the idea that the units, now called genes, are located on chromosomes. In the mid-20th century the structure of DNA was determined and the mechanism of gene function was worked out.
The work of many scientists over many years led to the gene theory being developed.