Landscape ecology plays a vital role in understanding the impacts of land-use change on biodiversity, but it is not a predictive discipline, lacking theoretical models that quantitatively predict biodiversity patterns from first principles. Here, we draw heavily on ideas from phylogenetics to fill this gap, basing our approach on the insight that habitat fragments have a shared history. We develop a landscape ‘terrageny’, which represents the historical spatial separation of habitat fragments in the same way that a phylogeny represents evolutionary divergence among species. Combining a random sampling model with a terrageny generates numerical predictions about the expected proportion of species shared between any two fragments, the locations of locally endemic species, and the number of species that have been driven locally extinct. The model predicts that community similarity declines with terragenetic distance, and that local endemics are more likely to be found in terragenetically distinctive fragments than in large fragments. We derive equations to quantify the variance around predictions, and show that ignoring the spatial structure of fragmented landscapes leads to over-estimates of local extinction rates at the landscape scale. We argue that ignoring the shared history of habitat fragments limits our ability to understand biodiversity changes in human-modified landscapes.