Migration by nematode larvae through the tissues of their mammalian hosts can cause considerable pathology, and yet the evolutionary factors responsible for this migratory behaviour are poorly understood. The behaviour is particularly paradoxical in genera such as Ascaris and Strongylus in which larvae undergo extensive migrations which begin and end in the same location. The orthodox explanation for this apparently pointless behaviour is that a tissue phase is a developmental requirement following the evolutionary loss of skin penetration or intermediate hosts. Yet tissue migration is not always necessary for development, and navigation and survival in an array of different habitats must require costly biochemical and morphological adaptations. Migrating larvae also risk becoming lost or killed by the host. Natural selection should therefore remove such behaviour unless there are compensating benefits. Here we propose that migration is a selectively advantageous life-history strategy. We show that taxa exploiting tissue habitats during development are, on average, bigger than their closest relatives that develop wholly in the gastrointestinal tract. Time to reproduction is the same, indicating that worms with a tissue phase during development grow faster. This previously unsuspected association between juvenile habitat and size is independent of any effects of adult habitat, life-cycle, or host size, generation time or diet. Because fecundity is intimately linked with size in nematodes, this provides an explanation for the maintenance of tissue migration by natural selection, analogous to the pre-spawning migrations of salmon.