Drosophila melanogaster can be artificially selected for increased resistance against parasitoid wasps that attack the larvae. Lines selected for greater resistance are poorer larval competitors under conditions of resource scarcity. Here we investigated the mechanistic basis of this apparent trade-off. We found that resistant lines have approximately twice the density of haemocytes (blood cells) than that of controls. Haemocytes are involved in encapsulation, the chief cellular immune defence against parasitoids. We have previously shown that resistant lines feed more slowly than controls and hypothesize that limiting resources are being switched from trophic to defensive functions.