Major histocompatibility complex

A major histocompatibility complex, or MHC, is a molecule on the outside of immune cells such as white blood cells. It is coded for by a large gene family in all vertebrates.
The function of is MHC molecules to sense foreign antigens, and hence the presence of 'foreign' proteins. They bind peptide fragments from pathogens onto their cell surface. Once there, the fragments are recognized by T-cells. Adaptive immunity depends on this reaction.
Effectiveness.
Two properties of MHC molecules make it difficult for pathogens to dodge the immune response.
1. MHC is polygenic. There are several different genes, so that each person or animal has a set of MHC molecules which bind somewhat different ranges of peptides.
2. The MHC genes are highly polymorphic. This means there are multiple variants alleles of each gene in the population. The polymorphism is so high that in a mixed population there are no two individuals with exactly the same set of MHC genes and molecules, with the exception of identical twins.
Inside a population, the presence of many different alleles means there will almost always be an individual with a specific MHC molecule able to load the correct peptide to recognize a specific microbe. The evolution of the MHC polymorphism means that a population will not succumb to a new pathogen or a mutated one, because at least some individuals will be able to develop an adequate immune response to defeat the pathogen. The variations in the MHC molecules are the result of the inheritance of different MHC molecules.
Transplants.
Transplants are limited to those which get the least reaction from the MHC system in tests of tissue matches.
Autoimmune diseases.
An autoimmune disease occurs when the immune cells do not recognize the MHC molecules of other cells and starts attacking its own body.