Changes in the maternal environment leading to an altered intrauterine milieu can result in subtle insults to the fetus, promoting increased lifetime disease risk and/or disease acceleration in childhood and later in life. Particularly worrisome is that the prevalence of NAFLD is rapidly increasing among children and adults, and is being diagnosed at increasingly younger ages, pointing towards an early-life origin. A wealth of evidence, in humans and non-human primates, suggests that maternal nutrition affects the placenta and fetal tissues, leading to persistent changes in hepatic metabolism, mitochondrial function, the intestinal microbiota, liver macrophage activation and susceptibility to NASH postnatally. Deleterious exposures in utero include fetal hypoxia, increased nutrient supply, inflammation and altered gut microbiota that might produce metabolic clues, including fatty acids, metabolites, endotoxins, bile acids and cytokines, which prime the infant liver for NAFLD in a persistent manner and increase susceptibility to NASH. Mechanistic links to early disease pathways might involve shifts in lipid metabolism, mitochondrial dysfunction, pioneering gut microorganisms, macrophage programming and epigenetic changes that alter the liver microenvironment, favouring liver injury. In this Review, we discuss how maternal, fetal, neonatal and infant exposures provide developmental clues and mechanisms to help explain NAFLD acceleration and increased disease prevalence. Mechanisms identified in clinical and preclinical models suggest important opportunities for prevention and intervention that could slow down the growing epidemic of NAFLD in the next generation.