The study aimed to identify the key active components in Silybum marianum (S. marianum) and determine how they protect against nonalcoholic fatty liver disease (NAFLD). TCMSP, DisGeNET, UniProt databases, and Venny 2.1 software were used to identify 11 primary active components, 92 candidate gene targets, and 30 core hepatoprotective gene targets in this investigation, respectively. The PPI network was built using a string database and Cytoscape 3.7.2. The KEGG pathway and GO biological process enrichment, biological annotation, as well as the identified hepatoprotective core gene targets were analyzed using the Metascape database. The effect of silymarin on NAFLD was determined using H&E on pathological alterations in liver tissues. The levels of liver function were assessed using biochemical tests. Western blot experiments were used to observe the proteins that were expressed in the associated signaling pathways on the hepatoprotective effect, which the previous network pharmacology predicted. According to the KEGG enrichment study, there are 35 hepatoprotective signaling pathways. GO enrichment analysis revealed that 61 biological processes related to the hepatoprotective effect of S. marianum were identified, which mainly involved in response to regulation of biological process and immune system process. Silymarin was the major ingredient derived from S. marianum, which exhibited the hepatoprotective effect by reducing the levels of ALT, AST, TC, TG, HDL-C, LDL-C, decreasing protein expressions of IL-6, MAPK1, Caspase 3, p53, VEGFA, increasing protein expression of AKT1. The present study provided new sights and a possible explanation for the molecular mechanisms of S. marianum against NAFLD.