Insects commonly harbor facultative bacterial endosymbionts, such as Wolbachia and Spiroplasma species, that are vertically transmitted from mothers to their offspring. These endosymbiontic bacteria increase their propagation by manipulating host reproduction or by protecting their hosts against natural enemies. While an increasing number of studies have reported endosymbiont-mediated protection, little is known about the mechanisms underlying this protection. Here, we analyze the mechanisms underlying protection from parasitoid wasps in Drosophila melanogaster mediated by its facultative endosymbiont Spiroplasma poulsonii. Our results indicate that S. poulsonii exerts protection against two distantly related wasp species, Leptopilina boulardi and Asobara tabida. S. poulsonii-mediated protection against parasitoid wasps takes place at the pupal stage and is not associated with an increased cellular immune response. In this work, we provide three important observations that support the notion that S. poulsonii bacteria and wasp larvae compete for host lipids and that this competition underlies symbiont-mediated protection. First, lipid quantification shows that both S. poulsonii and parasitoid wasps deplete D. melanogaster hemolymph lipids. Second, the depletion of hemolymphatic lipids using the Lpp RNA interference (Lpp RNAi) construct reduces wasp success in larvae that are not infected with S. poulsonii and blocks S. poulsonii growth. Third, we show that the growth of S. poulsonii bacteria is not affected by the presence of the wasps, indicating that when S. poulsonii is present, larval wasps will develop in a lipid-depleted environment. We propose that competition for host lipids may be relevant to endosymbiont-mediated protection in other systems and could explain the broad spectrum of protection provided.