Ecological validity is whether a study's methods and findings, often gathered under artificial conditions, generalize to real-world settings and everyday behavior.
A lot of psychology happens in tightly controlled lab settings, for good reason — control makes it easier to isolate cause and effect. But that control comes at a cost. If researchers study aggression by having participants blast a stranger with noise through headphones after losing a rigged computer game, the results might be perfectly real within that room and still tell you very little about how people actually behave during a real conflict, like a heated argument with a partner or a moment of road rage. That gap between the lab task and real life is what ecological validity is about.
It's closely related to, but not identical to, external validity. External validity is the broader question of whether findings generalize beyond the specific study at all — to other people, places, or times. Ecological validity is more specifically about whether the setting and task themselves resemble the real-world conditions the researcher wants to draw conclusions about, regardless of who the sample was.
Researchers can improve ecological validity by using more naturalistic tasks, real-world behavior tracking, or field studies instead of lab simulations, though this usually trades away some of the tight experimental control that makes cause-and-effect claims easier to defend in the first place.