The evolutionary processes that shape host-parasitoid coexistence in a changing environment and in running time are poorly understood. We examined the large-scale distribution of highly-specialized polysphinctine Darwin wasps associated with spiders along an elevational gradient and tested the hypothesis that distribution and parasitism rates depend on elevation, habitat type, and the species and age composition of the host community. Further, on the basis of a large-scale dataset, we examined the hypothesis that three-dimensional webs in spiders may be an evolutional adaptation against polysphinctine parasitoids. We found significant variation in parasitoid distribution and parasitism rates along a 1500 m elevational gradient in central Europe. The optimal model showed a humped shape for the parasitism rate on an elevational gradient. Overall, we found relatively low parasitism rates (4%) on spiders, with the highest parasitism rates in non-forested riparian vegetation and the lowest in agroecosystems. Rates of parasitism varied significantly among spiders forming different types of webs (foraging guilds). Spiders spinning 3D webs were dominant in the spider community, but parasitism on them was lower compared to spiders spinning 2D webs, probably because of the defensive function of the 3D web architecture. The bottom-up approach supports the theory that 3D webs are evolutionarily novel and arose as a result of the need for defence against enemies such as parasitoids.