The study of the interactions between nematodes and their environment, including soil microorganisms and plants.