Lactulose is not absorbed in the small intestine nor broken down by human enzymes, thus stays in the digestive bolus through most of its course, causing retention of water through osmosis leading to softer, easier-to-pass stool. It has a secondary laxative effect in the colon, where it is fermented by the gut flora, producing metabolites which have osmotic powers and peristalsis-stimulating effects (such as acetate), but also methane associated with flatulence.
Lactulose is metabolized in the colon by bacterial flora into short-chain fatty acids, including lactic acid and acetic acid. These partially dissociate, acidifying the colonic contents (increasing the H concentration in the gut). This favors the formation of the nonabsorbable  from NH, trapping NH in the colon and effectively reducing plasma NH concentrations. Lactulose is therefore effective in treating hepatic encephalopathy. Specifically, it is effective as secondary prevention of hepatic encephalopathy in people with cirrhosis. Moreover, research showed improved cognitive functions and health-related quality of life in people with cirrhosis with minimal hepatic encephalopathy treated with lactulose.