Although the influence of dispersal on coexistence mechanisms in metacommunities has received great emphasis, few studies have addressed how such influence is affected varying regional heterogeneity. We present a mechanistic model of resource competition in a metacommunity based on classical models of plant competition for limiting resources. We defined regional heterogeneity as the differences in resource supply rates (or resource availabilities) across local communities. As suggested by previous work, the highest diversify occurred at intermediate levels of dispersal among local communities. However our model shows how the effects of dispersal depend on the amount of heterogeneity among local communities and vice versa. Both regional and local species richness were the highest when heterogeneity was intermediate. We suggest that empirical studies that found no evidence for source–sink or mass effects at the community level may have examined communities with limited ranges of dispersal and regional heterogeneity. This model of species coexistence contributes to a broader understanding of patterns in real communities.