Interactions between demography and environmental effects are important determinants of population dynamics