Wikipedia
The major histocompatibility complex (MHC) is a set of cell surface proteins essential for the acquired immune system to recognize foreign molecules in vertebrates, which in turn determines histocompatibility. The main function of MHC molecules is to bind to peptide fragments derived from pathogens and display them on the cell surface for recognition by the appropriate T-cells. MHC molecules mediate interactions of leukocytes, also called white blood cells (WBCs), which are immune cells, with other leukocytes or with body cells. The MHC determines compatibility of donors for organ transplant, as well as one's susceptibility to an autoimmune disease via crossreacting immunization. In humans, the MHC is also called the human leukocyte antigen (HLA).
In a cell, protein molecules of the host's own phenotype or of other biologic entities are continually synthesized and degraded. Each MHC molecule on the cell surface displays a molecular fraction of a protein, called an epitope. The presented antigen can be either self or non-self, thus preventing an organism's immune system targeting its own cells. In its entirety, the MHC population is like a meter indicating the balance of proteins within the cell.
The MHC gene family is divided into three subgroups: class I, class II, and class III. Class I MHC molecules have β2 subunits so can only be recognised by CD8 co-receptors. Class II MHC molecules have no β2 subunits so can be recognised by CD4 co-receptors. In this way MHC molecules chaperone which type of lymphocytes may bind to the given antigen with high affinity, since different lymphocytes express different TCR co-receptors.
Diversity of antigen presentation, mediated by MHC classes I and II, is attained in at least three ways: (1) an organism's MHC repertoire is polygenic (via multiple, interacting genes); (2) MHC expression is codominant (from both sets of inherited alleles); (3) MHC gene variants are highly polymorphic (diversely varying from organism to organism within a species). Major histocompatibility complex and sexual selection has been observed in male mice making mate choices of females with different MHCs and thus demonstrating sexual selection. Also, at least for MHC I presentation, there has been evidence of antigenic peptide splicing which can combine peptides from different proteins, vastly increasing antigen diversity.