A primary driver of species extinctions and declining biodiversity is loss and fragmentation of habitats owing to human activities. Many studies spanning a wide diversity of taxa have described the relationship between population density and habitat patch area, i.e., the density–area relationship (DAR), as positive, neutral, negative or some combination of the three. However, the mechanisms responsible for these relationships remain elusive. We employ a theoretical spatially explicit population model built upon the reaction–diffusion framework with absorbing boundary conditions to model a habitat specialist dwelling in islands of habitat surrounded by a hostile matrix. We consider patches with a convex or non-convex geometry. Our results show that a single species following logistic-type population growth exhibits a strictly positive and continuous DAR. However, when multiple asymptotically stable steady states are preset in the system, a discontinuous DAR arises. In the case of two species governed by diffusive Lotka–Volterra growth and competitive interactions, we observe that overall DAR structure can be either (1) positive, (2) positive for small areas and neutral for large, or (3) hump-shaped, i.e., positive for area below a threshold and negative for area above. Patch complexity such as non-convex geometry can cause discontinuities in DAR slope for a single species and create qualitatively different patterns in a competitive system as compared to a convex patch. We also compared our theoretical results with two empirical studies (Anolis lizards on islands and crossbills and pine squirrels in forest fragments) where the pragmatic view of DAR fails to give a mechanistic understanding of what was observed. Close qualitative agreement between theoretical and observed DAR indicates that our model gives a reasonable explanation of the mechanisms underpinning DAR found in those studies. From a conservation perspective, the DAR is crucial to the identification of valuable habitat fragments that favor high abundance and the design of a reserve for a target species. When it comes to protecting a single species, these results suggest that there is unlikely to be a simple solution and that conservation decisions should always be made on a case-by-case basis.