The aim of this study was to investigate the reasons for the differences in lipid accumulation between lean and obese pigs. The bile acids with varying levels within two types of pigs were found and then in vitro experiments were conducted to identify whether these bile acids can directly affect lipid accumulation. Fourteen pigs, including seven lean and seven obese pigs with body weights of approximately 80 kg, were fed the same diet at an amount approximately equivalent to 3% of their respective body weights daily for 42 d. In vitro, 3T3-L1 preadipocytes were cultured in medium with high glucose levels and were differentiated into mature adipocytes using differentiation medium. Then, bile acids were added to mature adipocytes for 4 d. The results showed that there was a difference in body lipids levels and gut microbiota composition between obese and lean pigs (P < 0.05). According to the results of gut microbial function prediction, the bile acid biosynthesis in colonic digesta of obese pigs were different from that in lean pig. Sixty-five bile acids were further screened by metabolomics, of which 4 were upregulated (P < 0.05) and 2 were downregulated (P < 0.05) in obese pigs compared to lean pigs. The results of the correlation analysis demonstrated that chenodeoxycholic acid-3-β-D-glucuronide (CDCA-3Gln) and ω-muricholic acid (ω-MCA) had a negative correlation with abdominal fat weight and abdominal fat rate, while isoallolithocholic acid (IALCA) was positively associated with crude fat in the liver and abdominal fat rate. There was a positive correlation between loin muscle area and CDCA-3Gln and ω-MCA (P < 0.05), however, IALCA and 3-oxodeoxycholic acid (3-oxo-DCA) were negatively associated with loin eye muscle area (P < 0.05). Isoallolithocholic acid increased the gene expression of peroxisome proliferator-activated receptor gamma (PPARG) and the number of lipid droplets (P < 0.05), promoting the lipid storage when IALCA was added to 3T3-L1 mature adipocytes in vitro. In conclusion, the concentration of bile acids, especially gut microbiota related-secondary bile acids, in obese pigs was different from that in lean pigs, which may contribute to lipid accumulation within obese pigs.