Lactiplantibacillus plantarum is a nomadic species that displays adaptive variations in different habitats, particularly in the intestines. Bile salts tolerance is crucial for L. plantarum to survive and exert beneficial properties in this environment. L. plantarum exhibits varying growth capacities under bile salts exposure; however, the molecular mechanisms responsible for this variation are not fully understood. In this study, comparative genomics analysis was used to elucidate the specific genes in bile salts-tolerant L. plantarum and further investigate the mechanisms that contribute to bacterial survival under bile salts. A total of eighty-seven specific genes were identified in the tolerant strains, which were primarily associated with the two-component system and carbohydrate metabolism. Notably, the mutation of a response regulator (agrA) in the two-component system decreased the growth rate of L. plantarum under bile salts exposure, whereas complementation increased tolerance. Metabolomic analysis suggested that the deletion of agrA resulted in the downregulation of pathways associated with bacterial energy metabolism. These findings indicate that L. plantarum responds to harsh environments by sensing bile salts as signaling molecules and subsequently adjusting complex metabolic pathways as a survival strategy. This provides novel insights into the molecular basis of the two-component system contributing to bile salts tolerance.