The major histocompatibility complex and its functions. The function of MHC molecules is to bind peptide fragments derived from pathogens and display them on the cell surface for recognition by the appropriate T cells.