Mushrooms are a fungus. In general, fungi feed on rotting biological compounds - i.e. corpses. So, I suggest that mushrooms have a higher likelyhood of spawning on tiles containing corpses, and that they accelerate any rotting process in their tiles.
To expand on this: dead plants could increase this effect more than dead animals; bones could increase it but only very slightly. Most dead critters would tend to spawn normal giant mushrooms, but dead magical critters (mages, blink dogs, maybe mutants?) could slightly increase the tendency to spawn magical mushrooms.
I'm just thinking about hauling all those zombie/plant corpses into a room to build yourself a mushroom farm... which I do sometimes anyways, when I run into a patch I sometimes like to leave one alive to spawn more snacks for me later.
"Put more stuff in the... thing where... more stuff goes in."