The goal of avoiding distraction (e.g., ignoring words when naming their print colors in a Stroop task) is opposed intrinsically by the penchant to process conspicuous and correlated characteristics of the environment (e.g., noticing trial-to-trial associations between the colors and the words). To reconcile these opposing forces, the authors propose a tectonic theory of selective attention in which 2 memory-based structures--dimensional imbalance and dimensional uncertainty--drive selection by processing salient, surprising, and/or correlated information contained within and across stimulus dimensions. Each structure modulates the buildup of excitation to targets and the buildup of inhibition to distractors and to memories of previous stimuli. Tectonic theory is implemented to simulate the impact of 4 types of context on the presence, magnitude, and direction of congruity effects and task effects in the Stroop paradigm. The tectonic model is shown to surpass other formal models in explaining the range and diversity of Sroop effects.