The role of heterogeneity in animal population dynamics