**4. Discussion**

In this study, we found that juvenile hormone enhances resistance against the entomopathogenic fungi in the males of *T. molitor*, which contradicts the results by some previous studies [8,11,15], which have found that juvenile hormone corrupts immunity. However, we found that juvenile hormone reduced resistance against the entomopathogenic fungi in females. Thus, the effects of juvenile hormone on the immune system are much more complicated than previously thought. The reason why juvenile hormone had a different effect on the immune system in males and females in our study remains unclear. One possibility is that instead of corrupting the immunocompetence, juvenile hormone may rather cause a reallocation of the resources to those parts of the immune defense which need them the most (as has been proposed in vertebrates for testosterone and immunity [20]). Since optimal life history strategies differ between the sexes, the optimal reallocation of the resources between different immunity arms may also differ.

Interestingly, there were sex differences in resistance in the control treatment group: females having stronger resistance against the fungi than males. It has been suggested that the ultimate mechanism for the observed sex differences in immune function could be a differential selection favoring different investment levels in the immune defense system [21,22]. Because female fitness is limited by the number of offspring produced, whereas male fitness is limited by the number of females fertilized, males are expected to invest more in sexual competition and current reproduction at the expense of their immune defense compared to females (the Bateman Principle) [21]. However, an experimental study found no sex differences in parasite infections among arthropod hosts [23]. Likewise, efforts to examine the sex differences in innate immune function in insects have been met with mixed results [24]. Thus, more studies testing the sex differences in insects using real parasites and pathogens would be needed to test the Bateman principle in insects. On the other hand, it was shown that sex-specific responses to experimental manipulation of fitness-limiting resources affects both the magnitude and direction of sex differences in immune function [22,25]. This suggests that for species similarly limited in their reproduction, phenotypic plasticity would be an important determinant of sex differences in immune function and other life-history traits. Likewise, immunological sex differences were found in the autumnal moth, *Epirrita autumnata*, which varied in populations differing in their degree of inbreeding [26]. Thus, it seems that there are plausible explanations for sexual dimorphism in immunity other than just the Bateman principle, which is traditionally used to explain the observed sex difference in immunity [21].

Since our previous studies with *T. molitor* found that the administration of juvenile hormone reduced phenoloxidase activity and the encapsulation response against a nylon monofilament [8], the results of this study sugges<sup>t</sup> that the effect of juvenile hormone differs between specific and non-specific immunity in *T. molitor*. Interestingly, in the autumnal moth, *E. autumnata*, the encapsulation response against a nylon monofilament was positively associated with the resistance against *B. bassiana* [26]. However, it has been shown that cellular antifungal reactions, such as phagocytosis and multicellular encapsulations, are suppressed during the development of fungal diseases [27]. Thus, encapsulation or phenoloxidase activities may not mirror the resistance against fungal pathogens, being indirectly correlated via the individuals' general condition. Thus, it seems that the association between the specific and non-specific parts of immunity appears to be very complicated. Our study highlights the importance of using real parasites and pathogens in immuno-ecological studies.

**Author Contributions:** I.M.D., M.P., T.K., M.J.R. and I.A.K. conceived the idea. I.M.D., M.P., M.J.R. and J.C.-G., designed the experiments. I.M.D., T.K. and I.A.K. provided the resources. I.M.D. and M.P. performed the experiments. M.J.R., M.P., I.M.D., T.K. and J.C.-G. analyzed the data. M.J.R. and I.M.D. wrote the original draft. M.J.R., I.M.D., M.P., T.K., J.C.-G. and I.A.K. revised and edited the manuscript. M.J.R., I.M.D., M.P., T.K., J.C.-G. and I.A.K. approved the manuscript for publication. All authors have read and agreed to the published version of the manuscript.

**Funding:** The study was supported by the Academy of Finland (grants to M.J.R.), Kone foundation (grants to I.M.D.), the Russian Science Foundation (project 19-16-00019 to I.M.D.), the Latvian Science Council (lzp-2018/1-0393 to I.A.K. and T.K.) and the Estonian Research Council (PUT1223 to I.A.K.) and T.K.).

**Conflicts of Interest:** The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.
