The key to T-cell immunity lies in the somatic gene rearrangement of the antigen receptors expressed on the surface of T-cells. This process produces an almost infinite array of specific configurations from a finite number of genes. In an analogous fashion, a kaleidoscope can produce an almost infinite array of patterns from just a few coloured disks.
This process occurs during T-cell maturation in the thymus. T-cells which bind too strongly or too weakly to self molecules are thymically deleted through events called negative or positive selection. Thus, thymic selection gives rise to a peripheral T-cell population bearing TCRs that can discriminate between self and non-self antigens, and induce T-cell immune responses against infected cells.
The generation of a mature pool of T-cells that have the ability to tolerate self-molecules, whilst offering an adequate level of immune-surveillance against foreign invaders, represents a significant challenge to the immune system. In fact, in order to detect all possible invaders, T-cells must retain a very high degree of cross-reactivity, whilst remaining tolerant to healthy tissues. Precisely how T-cells achieve this careful balance is not yet fully understood.