A can of food can swell for two separate reasons. The first is what food scientists call “hydrogen swelling,” and it only happens to cans of acidic food such as tomatoes or citrus fruit.
The acids in the food begin to attack and dissolve the metal lining of the can, and one of the by-products of this chemical reaction is hydrogen gas. Because the can is sealed, the gas builds up, causing the can to swell.