Parasitism is a common form of life and represents a strong selective pressure for host organisms. In response to this evolutionary pressure, vertebrates have developed genetically coded defences such as the major histocompatibility complex (MHC). Mechanisms of parasite-mediated selection not only maintain outstanding polymorphism in these genes but have also been proposed to further promote host population divergence and ultimately speciation because it can drive evolution of local adaptation in which MHC genes play a crucial role. This review first highlights the dynamics and complexity of parasite-mediated selection in natural systems, which not only depends on dominating parasite strategies and on the taxonomic diversity of the parasite community but also includes the differences in parasite communities between habitats and niches, creating divergent selection on locally adapted populations. Then the different ways in which MHC genes potentially allow vertebrates to respond to these dynamics and to adapt locally are outlined. Finally, it is proposed that varying selection strength in time and space may lead to variation in the strength of precopulatory reproductive isolation which has evolved to maintain local adaptation.