When Lima beans are attacked by a caterpillar, they know how to defend themselves:
Plants have evolved a wide range of direct and indirect defensive strategies against being eaten by herbivores, like the indirect defense using semio-chemicals, i.e. chemicals that carry a message. The caterpillar of Spodoptera littoralis , the African cotton leafworm or Egyptian cotton leafworm, is a noctuid moth found widely in Africa and Mediterranean Europe. The cotton leafworm caterpillar is attacked by two parasitic wasps, one belonging to the Ichneumonidae, the other one to the Braconidae.
We are amazed by the “smart” defense mechanism that plants have evolved during their evolutionary past.
But these parasitic wasps? If we remember correctly, Ichneumonidae are bad guys, at least this is their reputation. Charles Darwin (who died on this day in 1882) wrote in a letter to his friend Asa Gray on 22 May 1860:
I cannot persuade myself that a beneficent and omnipotent God would have designedly created the Ichneumonidae with the express intention of their feeding within the living bodies of caterpillars.
Would Charles Darwin have judged differently had he known that plants have called the Ichmeumonidae to help them defend themselves? I don’t know. But I doubt it.
Charles Darwin’s concept of God was one of “God as Designer”, as portrayed by William Paley. This concept is outdated in a world where we think in ecosystems, and in interconnectedness.
In the 21th century, we need another perspective on God’s action in creation. I propose the following text in Pope Francis encyclical “Laudato Si”:
Creating a world in need of development, God in some way sought to limit himself in such a way that many of the things we think of as evils, dangers or sources of suffering, are in reality part of the pains of childbirth which he uses to draw us into the act of cooperation with the Creator.(49) God is intimately present to each being, without impinging on the autonomy of his creature, and this gives rise to the rightful autonomy of earthly affairs (50). His divine presence, which ensures the subsistence and growth of each being, “continues the work of creation”.(51) The Spirit of God has filled the universe with possibilities and therefore, from the very heart of things, something new can always emerge: “Nature is nothing other than a certain kind of art, namely God’s art, impressed upon things, whereby those things are moved to a determinate end. It is as if a shipbuilder were able to give timbers the wherewithal to move themselves to take the form of a ship”(52). 
 Mithöfer A, Wanner G, Boland W. Effects of Feeding Spodoptera littoralis on Lima Bean Leaves. II. Continuous Mechanical Wounding Resembling Insect Feeding Is Sufficient to Elicit Herbivory-Related Volatile Emission. Plant Physiology. 2005;137(3):1160-1168. doi:10.1104/pp.104.054460.
 Morales, J, Medina, P, Vinuela, E. The influence of two endoparasitic wasps, Hyposoter didymator and Chelonus inanitus, on the growth and food consumption of their host larva Spodoptera littoralis. BioControl 2006; 52, 145-160. doi: 10.1007/s10526-006-9026-4
 Pope Francis, Laudato Si, 80; (49) : cf CCC 310; (50) Gaudium et Spes 36; (51) Thomas Aquinas, Summa Theologiae, I, q. 104, art. 1 ad 4; (52) Ibid., In octo libros Physicorum Aristotelis expositio, Lib. II, lectio 14