What is the difference between ecological validity and external validity?

Ecological validity is a subtype of external validity that is specifically concerned with the extent to which the study environment, tasks, and conditions reflect the real-world settings in which the behavior naturally occurs.

External validity also consists of population validity, which refers to the extent to which the results of a study can be generalized to the larger population from which the sample was drawn.