The function of the gastrointestinal tract relies on a monolayer of epithelial cells, which are essential for the uptake of nutrients. The fragile lining requires protection against insults by a diverse array of antigens. This is accomplished by the mucosa-associated lymphoid tissues of the gastrointestinal tract, which constitute a highly organized immune organ. In this Review, we discuss several recent findings that provide a compelling link between dietary compounds and the organization and maintenance of immune tissues and lymphocytes in the intestine. We highlight some of the molecular players involved, in particular ligand-activated nuclear receptors in lymphoid cells.