As a phase change occurs, they will either absorb or release energy, which is being transferred into or out of the phase change material. So thermal energy itself doesn't necessarily change location. What's really happening is that like the phase change materials themselves are altering.
Changes of state can be driven by both internal and external factors, or a combination of both. The truth is that even though certain items come to mind when we say PCMs, everything is technically a phase change material because there’s a temperature at which anything will change states.
For each material, it depends on what its melt point and freeze point are. Internally, every substance has its own makeup and chemical properties. But the external forces are really what drives the phase change. It has to have a temperature change. There has to be a Delta T between the object and its environment and that's where the thermal energy doesn't necessarily change, but it does transfer into the phase change material or out of the phase change material.
When this happens thermal energy is either absorbed or released. When it’s absorbed enough, the object melts. When it’s released enough, the object freezes.
What Factors Play a Role in This?
The short answer: everything.
There are so many things that can play a role in how a certain material changes phases:
Saltwater vs. Freshwater
Material will freeze or melt very differently in each of these situations. For example, we use salt on the roads in winter which depresses the freeze point.
If there's only one degree of difference between an object and that temperature, it's going to take a really, really long time to freeze.
Type of Heat Transfer
There's convection, conduction, and radiation. Sunlight would be a good example of radiation, convection is how air passes over an object and conduction is when two objects touch.
Moisture can also play a factor. If there is water present, it will change the freeze point of the PCM because it's also freezing during that time.