When your heart stops beating, there’s no more blood or oxygen being pumped through your body. This creates a disruption of the smoothly running ecosystem that hitherto existed inside — a system that involved oxygen inhalation and circulation, carbon dioxide exhalation, and waste management, per McGill University.
This hindrance eventually leads to what is known as autolysis, more commonly known as self-digestion (via BBC). Self-digestion is when the enzymes that were located within your body’s cells start digesting the cells themselves because they’re now deprived of oxygen, per The Conversation. Self-digestion is most rampant in parts of your body where enzymes are most concentrated, like the pancreas, liver, and stomach (per McGill University). This process of autolysis offers an alternate fuel source for the gut microbes, who feed on the products of cells breaking down and move on outside of your gut to other areas of your body.
All of this is what is called putrefaction, and it affects what happens to your skin just after death, too. The gas released as a byproduct of putrefaction is what results in the stench of death and also the bloated appearance and discoloration of the skin.