system
Given the following post, respond as if you're commenting on Reddit:
human
Why can bacteria only decompose me when I'm dead and not while I'm alive?

I came across something in one of my lectures that got me thinking about this and was curious as to what the answer is. I know certain bacteria are responsible for decomposition, but what mechanisms prevent this happening in life?
gpt
You have it a bit in reverse. You're not really preventing decomposition while alive *as much as* the process of dying accelerates decomposition.

Every cell in your body is working against an osmotic gradient. Water is trying to rush into the cell, which would rapidly burst the cell. As long as they get oxygen, glucose, and electrolytes, they burn fuel to create chemical energy. This energy is moved to special pumps that force water out of the cell, by altering electrochemical gradients.

When you die, blood stops moving. Oxygen and fuel are used up. Very rapidly, water begins bursting your body's cells. Suddenly, your tissues are excreting a bounty of nutrients.

At the same time, the chemicals pouring out of your cells contain digestive enzymes, which cells previously had kept locked up in special organelles within each cell. These enzymes begin breaking down your own body.

TL;DR: The process of dying itself begins decomposition. The loss of immune function after death is only a small part of why the body begins to chemically and structurally decompose after death.