In a developed ecosystem, even the predators are providers and energy is not lost, just converted.
In this picture, the caterpillar eating our pear tree is providing nutrients for a sunflower. My needs are only secondary and the fact that I would prefer to eat pears than sunflowers is irrelevant.
We gardeners have to learn our place in the ecosystems we develop. We are the conscious, guiding force, but there are others at play. Plants, pests, microbes, fungi and the whole gamut of life have been doing their thing since long before we got started and will do so long after we have gone.
Successful gardening acknowledges this and the gardener attempts to guide their charges to a balance that he or she envisions. Nothing more, nothing less.