Fetal programming associated with in utero exposure to maternal stress is thought to alter gene expression, resulting in phenotypes that promote survival in a pathogen-rich and nutrient-poor environment but substantially increase the risk of cardiovascular, metabolic and renal disorders (such as diabetes mellitus) in adults with obesity. These (epi)genetic phenomena are modified by environmental and socioeconomic factors, resulting in multiple subphenotypes and clinical consequences. In individuals from areas undergoing rapid economic development, which is associated with a transition from communicable to noncommunicable diseases, an efficient innate immune response can exaggerate obesity-associated inflammation. By contrast, in individuals with a genetic predisposition to autoimmune or monogenic diabetes mellitus, obesity can lead to atypical presentation of diabetes mellitus, termed 'double diabetes mellitus'. The increasingly young age at diagnosis of diabetes mellitus in developing countries results in prolonged exposure to glucolipotoxicity, low-grade inflammation and increased oxidative stress, which put enormous strain on pancreatic β cells and renal function. These conditions create a metabolic milieu conducive to cancer growth. This Review discusses how rapid changes in technology and human behaviour have brought on the global epidemic of metabolic diseases, and suggests that solutions will be based on using system change, technology and behavioural strategies to combat this societal-turned-medical problem.