Foraging behavior, as an energy-consuming behavior, is very important for collective survival in termites. How energy metabolism related to glucose decomposition and ATP production influences foraging behavior in termites is still unclear. Here, we analyzed the change in energy metabolism in the whole organism and brain after silencing the key metabolic gene isocitrate dehydrogenase (IDH) and then investigated its impact on foraging behavior in the subterranean termite Odontotermes formosanus in different social contexts. The IDH gene exhibited higher expression in the abdomen and head of O. formosanus. The knockdown of IDH resulted in metabolic disorders in the whole organism, including the impairment of the NAD+-IDH reaction and decreased ATP levels and glucose accumulation. The dsIDH-injected workers showed significantly reduced walking activity but increased foraging success. Interestingly, IDH downregulation altered brain energy metabolism, resulting in a decline in ATP levels and an increase in IDH activity. Additionally, the social context obviously affected brain energy metabolism and, thus, altered foraging behavior in O. formosanus. We found that the presence of predator ants increased the negative influence on the foraging behavior of dsIDH-injected workers, including a decrease in foraging success. However, an increase in the number of nestmate soldiers could provide social buffering to relieve the adverse effect of predator ants on worker foraging behavior. Our orthogonal experiments further verified that the role of the IDH gene as an inherent factor was dominant in manipulating termite foraging behavior compared with external social contexts, suggesting that energy metabolism, especially brain energy metabolism, plays a crucial role in regulating termite foraging behavior.