A decomposing whale carcass generates gases which build up inside their stomach and large internal organs. This then causes them to expand, but whale skin and blubber are tough so the gases become trapped inside, according to National Geographic.
Why do carcasses explode?
There have been several cases of exploding whale carcasses due to a buildup of gas in the decomposition process. Actual explosives have also been used to assist in disposing of whale carcasses, ordinarily after towing the carcass out to sea. ... The explosion threw whale flesh around 800 feet (240 metres) away.
Why do dead whales inflate?
According to National Geographic, after a whale dies, it's organs — stomach contents and everything — begin to decompose. This causes gases to build up and get trapped inside the body.