Atrial fibrosis is one of the main manifestations of atrial cardiomyopathy, an array of electrical, mechanical and structural alterations associated with atrial fibrillation (AF), stroke and heart failure. Atrial fibrosis can be both a cause and a consequence of AF and, once present, it accelerates the progression of AF. The pathophysiological mechanisms leading to atrial fibrosis are diverse and include stretch-induced activation of fibroblasts, systemic inflammatory processes, activation of coagulation factors and fibrofatty infiltrations. Importantly, atrial fibrosis can occur in different forms, such as reactive and replacement fibrosis. The diversity of atrial fibrosis mechanisms and patterns depends on sex, age and comorbidity profile, hampering the development of therapeutic strategies. In addition, the presence and severity of comorbidities often change over time, potentially causing temporal changes in the mechanisms underlying atrial fibrosis development. This Review summarizes the latest knowledge on the molecular and cellular mechanisms of atrial fibrosis, its association with comorbidities and the sex-related differences. We describe how the various patterns of atrial fibrosis translate into electrophysiological mechanisms that promote AF, and critically appraise the clinical applicability and limitations of diagnostic tools to quantify atrial fibrosis. Finally, we provide an overview of the newest therapeutic interventions under development and discuss relevant knowledge gaps related to the association between clinical manifestations and pathological mechanisms of atrial fibrosis and to the translation of this knowledge to a clinical setting.