Both fungi and bacteria decompose dead animals, but they play somewhat different roles.
Fungi secrete enzymes that break down complex organic matter such as lignin and cellulose, recycling nutrients into the soil.
Bacteria are single-celled decomposers that break down simpler compounds such as proteins and sugars.
Together, they break down tissues and return nutrients to the ecosystem, each suited to different materials based on their enzymes and metabolism.