This study shows that microbiome changes induced by bariatric surgery prevent diet-induced obesity and NAFLD by altering GIP signaling. This evidence concerns the gene GIP and metabolic dysfunction-associated steatotic liver disease.