Unravelling the effects of environmental variation on the population dynamics of structured populations