T helper 17 (Th17) cells are pathogenic in many inflammatory diseases, but also support the integrity of the intestinal barrier in a non-inflammatory manner. It is unclear what distinguishes inflammatory Th17 cells elicited by pathogens and tissue-resident homeostatic Th17 cells elicited by commensals. Here, we compared the characteristics of Th17 cells differentiating in response to commensal bacteria (SFB) to those differentiating in response to a pathogen (Citrobacter rodentium). Homeostatic Th17 cells exhibited little plasticity towards expression of inflammatory cytokines, were characterized by a metabolism typical of quiescent or memory T cells, and did not participate in inflammatory processes. In contrast, infection-induced Th17 cells showed extensive plasticity towards pro-inflammatory cytokines, disseminated widely into the periphery, and engaged aerobic glycolysis in addition to oxidative phosphorylation typical for inflammatory effector cells. These findings will help ensure that future therapies directed against inflammatory Th17 cells do not inadvertently damage the resident gut population.