The mechanism of Mendelian heredity refers to the principles established by Gregor Mendel that explain how traits are inherited through generations via discrete units known as genes. This mechanism includes the concepts of segregation and independent assortment, which describe how alleles separate during gamete formation and how different traits are passed independently from one another. These foundational ideas form the basis for modern genetics and help explain genetic variation in populations.