Bacteroides fragilis alleviates necrotizing enterocolitis through restoring bile acid metabolism balance using bile salt hydrolase and inhibiting FXR-NLRP3 signaling pathway. Here, NLRP3 is linked to necrotizing enterocolitis.