Advocate,
People have 6 MHC genes each. Organisms are mostly made of proteins, and proteins (AKA polypeptides) are linear series of building blocks called amino acids. They are linear but they fold into 3-dimensional shapes that do the molecular work of the body. Inside the cells is something that chops up samples of all proteins into polypeptide segments that are often about 9 or 10 amino acids in length. All different kinds of these stick into the MHC and then get displayed on the cell surface.
Since there are 20 amino acids, there are 20^9=512,000,000,000 different possible polypeptides with a length of 9 amino acids. Therefore, any pathogen should have some polypeptides that are different from all of yours. These create a certain 3-d structure when they bind into MHC.
T cell have a recepter, the TCR, which is a protein with a random sequence. Having a random sequence, it folds up into a random shape. These travel around and examine whether the random TCR fits with MHC : peptide complexes from your own body. If they do fit, and thus react strongly to your own body, they should be rendered permanently passive. If not, they are allowed to persist, and if they one day fit onto some MHC : peptide complex (and certain other criteria are met as well), they know that this peptide must be from some foreign entity inside the cell. So they either destroy the cell on whose surface that MHC : peptide complex is found, or, if it be a well-armed macrophage or monocyte, they simply tell it there is an invader inside and its time to ramp up the intensity of aggressive behaviors like production of reactive oxidative small molecules, antimicrobial peptides, etc.
I have simplified it in a way that distorts it a little bit, but not very much.