The full spectrum of relationships in biology ranges from obligate mutualism (mutually nourishing and necessary for each other's survival) to predatory competition. (not all competition is predatory) The relational dynamics that define an ecosystem is a result of a gravitation toward equilibrium between all the organisms that make up an ecosystem and their shared environment. This crafts the arrangement of an interrelated network that either establishes homeostasis (a balance between resources and organisms), or experiences instability depending on whether the various aspects are in sync with what the environment affords. As the environment changes, it also provides a necessity to adapt. Change is the constant. Given this basic relational nature of the playing field, we see what we see in a given biological landscape when we factor in that relationships have developed over time in this climate.
Sometimes the echoes of adaptations that were once necessary in the past and are no longer relevant, still reverberate, at the same time the ecosystem must also face the current necessities of adaptation to remain coherent. Different aspects of the relationship spectrum from mutualistic behaviors to competitive come to prominence or fade depending on the interplay of these complex variables.
Not all of the relationships exist in a fixed point on the spectrum. They can move over time. Neither are they always defined by a singular point on the spectrum. Sometimes an organism can have multiple qualities from different places on the relational spectrum. Here is an example of parasites that also have a protective quality about them: