The genetic basis of the immune response, including the role of MHC molecules and the genes encoding them.