We review mechanistic and evolutionary aspects of interactions between the model organism Caenorhabditis elegans and its environment. In particular, we focus on environmental effects affecting developmental mechanisms. We describe natural and laboratory environments of C. elegans and provide an overview of the different environmental responses of this organism. We then show how two developmental processes respond to changes in the environment. First, we discuss the development of alternative juvenile stages, the dauer and non-dauer larva. This example illustrates how development responds to variation in the environment to generate complex phenotypic variation. Second, we discuss the development of the C. elegans vulva. This example illustrates how development responds to variation in the environment while generating an invariant final phenotype.