Talking about parts of a mechanism in terms of "agency" is always a metaphor: A cogwheel or a transistor or a microchip doesn't "know" either what it's supposed to do. However, what is the case is that those parts are designed specifically to emphasize or to suppress particular physical effects.
And this kind of "design" can be found in cells and proteins as well - not by any kind of designer but through evolution of the whole organism and storage in the DNA.
I also believe this is the fundamental difference between an ecosystem and an organism: In an ecosystem, each part evolves on its own and the whole system is simply the result of all interactions. In an organism, the evolution of individual cells is constrained. It's only the oragnism as a whole that evolves. This means that all the chaotic interactions between the different parts of the organism aren't completely random either, because all those parts have a common playbook.
The evolution of the organism has tuned the interactions between the different parts in such a way that they result in particular outcomes - which increase the fitness of the organism as a whole.
E.g., from the POV of a white blood cell, it really may just be a selfish predator, however the way it is attuned to particular kinds of "prey" and the way other molecules and up- or downregulate its aggressiveness is not simply by chance.