A gene is a molecular unit of heredity in all living organisms. Genes are segments of the long-stranded DNA coiled around histone proteins to form Chromosome. Genes hold the information to build and maintain an organism's cell and pass genetic traits to offsprings.
Genetic inheritance, also called heredity, occurs due to the genetic material in form of DNA being passed from parents to their offsprings. The understanding of inheritance began with the work of an Austrian monk called Gregor Mendel, whose experimental discoveries provided the foundation of Modern genetics today. Mendel was accredited as the first person to correctly understand the process of how traits are inherited by offsprings from parents.
In sexual reproduction, the genetic material (contained in the gametes produced by meiosis) of the two parents (male and female) combines and passed on to the resulting offspring (s). When an organism undergoes reproduction, all the information for growth, survival and reproduction for the next generation is found in the DNA passed down from the parent generation.
In this case, the resistance developed by the weeds is a phenotypic characteristics which is encoded for by a gene in the weeds' genome. Hence, they pass down this chenmical-killer resistance trait to their offsprings during reproduction by the means of the genes contained in the gametes produced by meosis.