Latent heat and molecular behaviour
During a change of state (e.g. from a solid to liquid), the thermal energy absorbed by a substance goes into weakening or strengthening the intermolecular bonds.
Intermolecular bonds are weak forces that keep molecules in many solids and, to a lesser extent, in liquids close together.
The water molecules in ice are held together by intermolecular bonds.
The energy absorbed during a change of state does not increase the random kinetic energy of the particles.
For this reason the temperature of a substance is constant while it changes state.
The internal energy still changes during a change of state as the potential energy of the particles changes.
If a substance continues to absorb energy after the change of state, the random kinetic energy of its particles will start to increase again.