All raw foods contain bacteria. If the food sits around the bacteria will grow and spoil it.
Some bacteria produce gas which will make a sealed can swell or even blow up
Some bacteria produce a deadly posion.
When a can is sealed
no more bacteria can get in and the cook kills those on the inside.