All communities vary through time. This variability originates from both intrinsic and extrinsic sources. Intrinsic sources are due to actions of organisms in a community, i.e., population dynamics and species interactions, while extrinsic variability is variability created by elements of habitat or environmental change. There is a growing appreciation that these two sources may interact, producing patterns of community variability that cannot be predicted or explained by focusing on a single source. We performed a field experiment that simultaneously manipulated trophic structure (intrinsic) and habitat heterogeneity (extrinsic) in order to examine the interaction between sources of variability in a South Carolina (USA) stream macroinvertebrate community. To manipulate trophic structure, we experimentally altered local abundances of crayfish which are keystone species and ecosystem engineers, while our manipulation of habitat was to alter stream substrate heterogeneity. We focused on two types of community variability as responses to our manipulations: aggregate variability (i.e., variability of summed species) and compositional variability (i.e., variability in relative abundances of species) by monitoring community composition through a 10-week experiment. We found that community dynamics shifted from patterns in variability indicative of synchrony (high aggregate variability + low compositional) to variability indicative of compensation (low aggregate variability + high compositional) along a gradient of increasing habitat heterogeneity. However, the shift in community dynamics only occurred when crayfish were present in the community. Supporting evidence from the experiment suggested that sediment engineering effects of crayfish acted as a community-wide perturbation in low-heterogeneity habitat creating synchronous dynamics. However, in high-heterogeneity enclosures, crayfish effects were moderated by refugia provided by a more complex substratum. The switch from synchronous to compensatory dynamics is significant since compensation stabilizes aggregate community properties and ecosystem functions while synchrony frequently exacerbates aggregate variability. Results from this experiment demonstrate that an interaction between intrinsic and extrinsic sources of variability can alter community dynamics and that such an alteration does not occur in the absence of an interaction.