1. Both resources and natural enemies can influence the distribution of a herbivore. The ideal free distribution predicts that herbivores distribute themselves to optimise utilisation of resources. There is also evidence of herbivores seeking out refuges that reduce natural enemy attack (enemy-free space). Which of these theories predominates in a thistle–tephritid Terellia ruficauda (Diptera: Tephritidae)–parasitoid interaction is examined.
2. The plant, Cirsium palustre, had a contagious distribution approximated by the negative binomial distribution. Terellia ruficauda foraged preferentially and oviposited on isolated plants although its larvae gained neither nutritional benefit nor reduced natural enemy pressure from such behaviour.
3. Parasitoids of T. ruficauda foraged and oviposited more frequently on isolated than on crowded T. ruficauda, resulting in inverse density-dependent parasitoid attack at all spatial scales examined. Neither the herbivore nor natural enemies distributed themselves according to the predictions of the ideal free distribution and the herbivore did not oviposit to reduce natural enemy attack.
4. Extrapolating from the theoretical predictions of the ideal free distribution and enemy-free space to the field requires considerable caution. Terellia ruficauda and its parasitoids appear to select their oviposition sites to spread the risk of losses through factors (e.g. mammal herbivory) that may damage dense clusters of C. palustre.