Obesity and its complications are a global public health problem with increasing childhood prevalence. The developmental origins of health and disease (DOHaD) theory explain the maintenance of health or disease development throughout life, related to early life exposures. Although it arises from epidemiological observations, its support for epigenetics is strong. In this chapter, we address the importance of maternal diet in prenatal development, as well as the establishment of the infant microbiota and its postnatal regulating factors. According to the DOHaD theory, breastfeeding and other environmental factors are modulators or enhancers of the epigenetic mechanisms, which explain the increased incidence of noncommunicable diseases. We will discuss the molecular mechanisms related to the microbiota products, their effects on gene expression, and the pathophysiology of the disease. Finally, we will raise the areas of opportunity in childhood for preventive purposes, including the potential role of the use of prebiotics, probiotics, synbiotics, and postbiotics in early life.