Ideal free distribution theory attempts to predict the distribution of well-informed (‘ideal’) and unconstrained (‘free’) foragers in space based on adaptive individual decisions. When individuals differ in competitive ability, a whole array of equilibrium distributions is possible, and it is unclear which of these distributions are most likely. In the first part of our study, we show that strong competitors have an intrinsically stronger preference for highly productive habitat patches than poor competitors. This leads to an equilibrium distribution where the average competitive ability on a patch is strongly correlated with the productivity of the patch. In the second part of our study, we consider what happens if differences in competitive ability are heritable and, hence, subject to natural selection. Under constant environmental conditions, selection eliminates such differences: a single strategy prevails that optimally balances the costs and benefits associated with competitive ability. If the productivity of patches changes during the lifetime of individuals, the spatial assortment of competitors of equal competitive ability gives poor competitors a systematic advantage in times of environmental change, while good competitors benefit from equilibrium conditions. Using evolutionary individual-based simulations, we demonstrate that environmental change may then lead to the diversification of competitive ability.