The lymphoid tissues associated with the intestine are exposed continuously to antigen and are the largest part of the immune system. Many lymphocytes are found in organised tissues such as the Peyer's patches and mesenteric lymph nodes, as well as scattered throughout the lamina propria and epithelium of the mucosa itself. These lymphocyte populations have several unusual characteristics and the intestinal immune system is functionally and anatomically distinct from other, peripheral compartments of the immune system. This review explores the anatomical and molecular basis of these differences, with particular emphasis on the factors which determine how the intestinal lymphoid tissues discriminate between harmful pathogens and antigens which are beneficial, such as food proteins or commensal bacteria. These latter antigens normally provoke immunological tolerance, and inappropriate responses to them are responsible for immunopathologies such as food hypersensitivity and inflammatory bowel disease. We describe how interactions between local immune cells, epithelial tissues and antigen-presenting cells may be critical for the induction of tolerance and the expression of active mucosal immunity. In addition, the possibility that the intestine may act as an extrathymic site for T-cell differentiation is discussed. Finally, we propose that, under physiological conditions, immune responses to food antigens and commensal bacteria are prevented by common regulatory mechanisms, in which transforming growth factor beta plays a critical role.