The pack is filled with a supersaturated solution of sodium acetate, the sodium salt of vinegar. A saturated solution is a solution in which the maximum possible amount of chemical at a given temperature is dissolved. For some chemicals such a solution can be cooled below the temperature at which the chemical normally freezes and one gets a supersaturated solution. These supersaturated solutions, as you would expect, are not very stable, because the chemical actually does not want to exist as molecules at this lower temperature, but prefers to be bound with other molecules in a crystal. If the supersaturated solution is disturbed, that's exactly what happens, the chemical becomes a solid material. You trigger the freezing of the solution. Doing this the solution not only warms up to the actual freezing temperature of the chemical but also releases energy in form of heat because you are forming bonds between atoms to get a crystal. It is an exothermic process. The sodium acetate in heat packs freezes at 54 degree Celcius (130 degree Fahrenheit). If you squeeze a heat pack at room temperature (aka 'disturb the supersaturated solution') you induce this spontaneous freezing of the sodium acetate and that creates heat.
The original state of heat pack (depending on the brand you have) might be restored by boiling the heat pack and slowly letting it cool again. This gives you the supersaturated solution you had in the beginning.
to edcuate yourself🔬