It's that time of the year when skeletons, skulls, and bones have found their way onto cookies, porches, and storefront windows.

While skeletons are universally considered symbols of death, the process of turning a newly dead animal into a bony skeleton relies on an explosion of life that ushers in the process of decomposition. Much of this transformative process is performed by wriggling, scuttling, scurrying insects.

Through decades of careful observation and experimentation, entomologists have described a five-stage model of decomposition. This model explains how insects, in close collaboration with microorganisms, transform a warm body into a pile of bones while simultaneously recycling carbon, nitrogen, phosphorous, and numerous other nutrients so that other living things may grow and thrive.

It begins with a corpse

The first stage of decomposition (termed "the fresh stage") occurs between the moment of death and the first signs of bloat. Within this period, there are no outward signs of physical change, but bacteria already living within the carcass begin to digest tissues within the body.

Insects start arriving in the minutes to hours after the animal has died. Most insects colonizing during this initial period are flies from the Calliphoridae (blowflies), Muscidae (house flies), and Sarcophagidae (flesh flies) families.

These early flies seek out prime real estate to deposit their eggs. This is generally limited to the animal's natural cavities (e.g., nostrils or mouth), or within any external injuries (e.g., abrasions). The moisture levels and soft tissue within these areas make an ideal nursery habitat for young maggots to develop.

Bloat, maggots, and methane

Bloat comes next. In this second stage of decomposition, the lack of oxygen within the body begins to favour anaerobic microbes. These bacteria thrive in the absence of oxygen within the body.

As the bacteria begin expelling gases like hydrogen sulphide and methane, the abdomen begins to swell. The carcass begins to darken and smells foul. Because carcasses are an uncommon and short-lived source of nutrients, numerous insects may detect and travel to a carcass from kilometres away.

During the bloating stage, fly eggs hatch, and large quantities of maggots begin to feed on the flesh. At this point, beetles join in on the feeding frenzy. Some beetles, such as carrion beetles, will feed on the nutrient-rich flesh of the carcass.

Predaceous beetles, such as rove beetles and clown beetles, arrive to feed on the maggots.

Maggots work their magic

The third stage is known as "active decay." This stage begins when the carcass starts to slowly deflate, a process akin to a tire pierced by a nail. Larval insects gnaw small holes into the body cavities, allowing gases to escape.

Tissues begin to liquefy, giving the carcass a wet appearance, followed by the release of a putrid odour. By the end of the active decay stage, maggots concentrate their feeding within the chest cavity of the animal. Soon beetles dominate, with huge, huge numbers of rove beetles and clown beetles arriving to chow down on the maggots.

Once most of the flesh has been eaten away, the carcass enters the stage of advanced decay. The putrid odour of the carcass begins to subside, and most maggots leave the carcass to pupate in the underlying soil.

Next, adult dermestid beetles arrive at the carcass and begin laying eggs. Dermestid beetles — small round beetles covered in tiny scales — are scavengers that feed on a variety of dry materials: fur, feathers, dead plants, even carpets!

If they're not familiar to you, perhaps you haven't looked closely enough — a 2016 survey of arthropods in homes detected dermestid beetles in 100 percent of households.

Dermestid beetles finish the job

The final stage of decomposition is known as dry decay. Very few adult flies are attracted to the carcass at this stage. During dry decay, the carcass is reduced to bones, cartilage, dried skin, and hair. By this stage, there is little odour at all.

Larval dermestid beetles continue to clean the skeleton, leaving behind remains that look very similar to a disassembled skeleton. Dermestid beetles are so effective in cleaning bones, in fact, that they are regularly used by museums when preparing skeletons for collection and display.

The little things that run the world

While witnessing this beastly undertaking is not for those with squeamish stomachs, decomposition of animal remains is a fundamental process that cycles nutrients within ecosystems.

Nutrients like carbon (the basis of all life on Earth), phosphorous, and nitrogen, which all living things need to grow, are in limited supply in ecosystems. They must be constantly reused and recycled to ensure the continuation of life.

Following decomposition, the soil beneath the cadaver will contain a high concentration of nutrients relative to the surrounding ecosystem.

However, the nutrients released into the environment don't all stay in soil and plants. Nutrients and energy contained within the dead animal (whether a mouse, raccoon, or crow) are repurposed and repackaged into living, breathing insects.

When these insects complete feeding on a carcass, they disperse into the wider environment where they continue to be productive members of ecosystems.

These very same insects help pollinate our crops (including pumpkins), fill the bellies of insect-eating animals (such as bats), and are crucial to the decomposition of other dead organisms (like rats, toadstools, and snakes).

If you happen to stumble across animal bones this Halloween season, or any other time of the year — take a moment to consider the beastly drama that made this discovery possible. The Conversation

Paul Manning, Postdoctoral Researcher, Faculty of Agriculture, Dalhousie University.

This article is republished from The Conversation under a Creative Commons license. Read the original article.