Plants take up nutrients from the ground. The nutrients are tranferred to herbivores when they eat plants, to predators when they eat herbivores, to decomposers when they break down dead organisms.
Through this process, the nutrients are released again and become accessible for plants. This mighty flow is nature´s well-known cycling and recycling of matter.
Organisms live of each other and are connected in a food web. The web has several components, which you see here: The spruce is a plant, the squirrel a herbivore, the marten a carnivor and the burying bettle a decomposer.
One nibbles on a spruce cone, another chews on an elk horn! Herbivore or decomposer? Both! It is not unusual that a species has such a wide selection of food that it plays different roles.