Within evolutionary biology, this term has been used sporadically to refer to situations in which a pre-existing (and presumably well adapted and successful) trait has become obsolete or maladaptive due to changing biophysical or social environments but evolved complex behavioral decision-making rules ("Darwinian algorithms") accumulated by prior adaptations now preclude any effective re-adaptation—as organisms can only modify upon or "patch up" existing traits (which essentially have become inherited "baggage") rather than devolving, removing or "redesigning" a trait (i.e. Dollo's law of irreversability)—leaving the species hosting the trait struggling to keep up with natural selection and thus vulnerable to competitive disadvantage, extirpation or even extinction.
In the 1991 BBC lecture series Growing Up in the Universe, British evolutionary biologist Richard Dawkins once analogized the concept to that of a mountaineer blindly climbing up (because "evolution has no foresights") while not allowed to turn back downhill, ended up being trapped on one summit and thus cannot go anywhere else higher.
[1] Organisms are prone to make inappropriate choices when an environment changes suddenly because the evolved Darwinian algorithms (decision rules) that underly behavioral choices are only as complex as is necessary to yield adaptive outcomes under normal circumstances, and not so complex as to cover unforseen experimentally- or human-created contingencies.
An evolutionary trap occurs in any situation where a sudden anthropogenic change in the environment causes an organism to make a decision that normally (in the environment in which the organism evolved) would have been adaptive, but now results in a maladaptive outcome, although better alternatives are still available.
Over evolutionary time, hatchling sea turtles have evolved the tendency to migrate toward the light of the moon upon emerging from their sand nests.