The foundational principles of Darwinian evolution are variation, selection, and identity by descent. Oncogene amplification on extrachromosomal DNA (ecDNA) is a common event, driving aggressive tumour growth, drug resistance, and shorter survival in patients 1-4 . Currently, the impact of non-chromosomal oncogene inheritance—random identity by descent—is not well understood. Neither is the impact of ecDNA on variation and selection. Here, integrating mathematical modeling, unbiased image analysis, CRISPR-based ecDNA tagging, and live-cell imaging, we identify a set of basic “rules” for how random ecDNA inheritance drives oncogene copy number and distribution, resulting in extensive intratumoural ecDNA copy number heterogeneity and rapid adaptation to metabolic stress and targeted cancer treatment. Observed ecDNAs obligatorily benefit host cell survival or growth and can change within a single cell cycle. In studies ranging from well-curated, patient-derived cancer cell cultures to clinical tumour samples from patients with glioblastoma and neuroblastoma treated with oncogene-targeted drugs, we show how these ecDNA inheritance “rules” can predict, a priori , some of the aggressive features of ecDNA-containing cancers. These properties are entailed by their ability to rapidly change their genomes in a way that is not possible for cancers driven by chromosomal oncogene amplification. These results shed new light on how the non-chromosomal random inheritance pattern of ecDNA underlies poor outcomes for cancer patients.