Mushrooms are the visible, above-ground extensions of a much larger underground network of fungal tissue that absorbs nutrients directly from the surrounding soil. The exterior surface of a fungus is analogous to the interior surface of an animal's stomach. It secretes digestive enzymes and absorbs the resulting chemical soup directly.
By the time a mushroom emerges above ground, the fungus has usually been feeding in place for some time. Fungi send out specialized tendrils, or hyphae, into the soil and plants around them to expose a maximum of surface area to the surrounding environment. These hyphae then secrete the necessary proteins directly onto the edible matter. These proteins then do the work of breaking down plant and animal tissues chemically until the nutrients locked away in their bodies are liberated. This leaves the food supply partially liquefied and oozing over the surface of the fungus. Exterior cells of the fungus can then directly absorb the desired nutrients without the need for a distinct digestive system. Generally, this work is only done by the nonreproductive components of a fungus. The mushroom's ultimate goal is not to eat but to release spores that can spread the fungus far and wide to begin the process anew in a different location.