Johnno, rather than implying a magical strangeness to explain this, I would think along the following lnes.
We know that not all what at first seem parasitic behaviours necessarily have a destructive outcome, and we have an understanding that instead many mutually beneficial, symbiotic relationships have evolved and exist between many biological species, evolved being very much the key word.
Fungi are a very evolved form, at first glance seeming primitive, but ancient in evolotion lineage and they are incredibly varied and also undoubtedly complex in their relationships with both decaying and live matter.
Like any other lifeform, they too want to survive so endeavour and have evolved to ensure that the provider of their food source also survives.
This doesn't imply they have a consciouness or an awareness of self, it's all just part of life existing, its constant and holistic struggle to get by and survive, its evolution.