The food sample to be measured is dried and ground into a powder. Then it is placed into the bomb calorimeter, a strong metal container surrounded by a water bath. The metal container is pumped full of pure oxygen at 30 atmospheres pressure and the food is ignited. The steel container holds in the explosion. In air, not all of the peanut burns, but this isn't a problem in the bomb.
Pure oxygen promotes combustion, and high-pressure oxygen greatly enhances combustion.
All of the burnable parts of a dried and powdered peanut will burn in a calorimeter, leaving just a touch of ash. The calorimeter turns the energy stored in the peanut into heat flow. The temperature increase of the water and metal of the calorimeter reveals how many calories the food contained. For a physicist, the benefit of converting calories to joules is that work and all other forms of energy are also measured in joules. When food energy is measured in joules, we can estimate immediately how much work can be extracted from the food.