Hepatic encephalopathy (HE) is a neurological disorder that occurs in patients with liver insufficiency. However, its pathogenesis has not been fully elucidated. Pharmacotherapy is the main therapeutic option for HE. It targets the pathogenesis of HE by reducing ammonia levels, improving neurotransmitter signal transduction, and modulating intestinal microbiota. Compared to healthy individuals, the intestinal microbiota of patients with liver disease is significantly different and is associated with the occurrence of HE. Moreover, intestinal microbiota is closely associated with multiple links in the pathogenesis of HE, including the theory of ammonia intoxication, bile acid circulation, GABA-ergic tone hypothesis, and neuroinflammation, which contribute to cognitive and motor disorders in patients. Restoring the homeostasis of intestinal bacteria or providing specific probiotics has significant effects on neurological disorders in HE. Therefore, this review aims at elucidating the potential microbial mechanisms and metabolic effects in the progression of HE through the gut–brain axis and its potential role as a therapeutic target in HE.