Found this on the internet as I too was curious about deflating bloated bodies.
When you die, bacteria suddenly find themselves with a massive food supply. It's a smorgasbord of epic proportions. So they begin to feast and reproduce.
Bacteria produce waste as a byproduct of respiration and digestion. Some of that waste is gas.
So you have an accumulation of gasses in the hollow spaces of the body, most notably the abdominal cavity and digestive tract. As had accumulates, pressure increases. Simultaneously, the tissue containing this built up pressure weakens and softens as the bacteria digest it.
Sometimes, the gas will escape through orifices (the mouth, nose, and anus for example). It will do so violently in some cases, carrying partially decomposed material with it. In the Middle Ages, people sometimes exhumed courses and found the mouths and faces smeared with gore as a result of this process. They mistakenly concluded that the corpses might be wandering about at night, feasting on human blood.
Anyway, if the gas accumulates in the body without escaping for a time, you can get bloat. And yes, eventually this can end up with a rapid, even explosive release of decomposition gasses once something pierces the body or once the structural integrity of the tissue surrounding the gas fails.
thats fascinating, and the idea of getting a whiff of some rotten dudes death farts is making me fucking nauseous.