Fungi can be saprophytic, parasitic, or both. Most are thought to be saprophytic, feeding on dead organic matter. Many others are parasitic, feeding on living hosts, and some can switch between the two depending on conditions.
Saprophytic fungi
Saprophytic fungi feed on dead plants, dead wood, leaf litter, and dung. They release enzymes into the material around them and absorb the products. Oyster mushrooms on dead hardwood, shiitake on logs, and black bread mold on bread are all saprophytes.
Parasitic fungi
Parasitic fungi take nutrients from living organisms and usually harm them. Rust fungi and powdery mildews are parasites of crops. Rice blast attacks rice. Cordyceps parasitizes insects. Honey fungus attacks the roots of living trees.
Fungi that do both
Honey fungus (Armillaria) is the standard example of a fungus that is both. It attacks living roots, kills the tissue, and then feeds on the dead material it leaves behind.
Chicken of the woods (Laetiporus) is another. It is mainly known as a wood-decay fungus, and it often grows on oaks. It can cause brown rot in the heartwood of living trees, often after the bark has been damaged, and it also breaks down dead wood. Some sources describe it as a weak parasite.
Saprophyte or saprotroph
Older books use saprophyte for a fungus that feeds on dead matter. Many mycologists now prefer saprotroph, partly because saprophyte is also used for some plants, which can cause confusion. Both words describe the same feeding mode in fungi.
Telling them apart
Habitat and host are clues, not proof. A fungus growing on dead wood is probably saprophytic, but it may still be a weak parasite. A fungus growing on a living tree may be a parasite, or a decomposer that moved in after the tree was weakened. A single sample often cannot settle the question. For plant disease questions, a plant pathologist or a local extension service can help. For mushroom identification, a local mycological society is a good starting point.
What this means for foragers and growers
A mushroom growing from dead wood is often a saprophyte, but that tells you nothing about whether it is edible. Foragers still need to identify it properly.
For growers, the crop itself is the saprophyte. The main challenge is keeping competing fungi out of the substrate. Trichoderma, a fungus that parasitizes other fungi, is one of the most common contaminants in mushroom growing, and it can overwhelm a crop. Clean technique is the main defense.