Some species of beetle are decomposers – to put it more simply, they help break down dead plant life, animal waste, or animal carcasses. As noted before, different species of beetles will have different food and behaviors. Some will feed on decomposing leaves and other plant matter on the forest floor. Other beetles feed on decaying wood, and along with fungi, help to decompose these materials, making way for new plant life to emerge.
In fact, forensic scientists actually depend on some beetle species (and fly species) as a primary method to help them determine time of death based on the stage of growth of beetle eggs, larvae, pupae or adults that are almost always present in dead bodies that have been exposed to the elements.