Original: When the temperature of a substance changes, the energy that is stored in the intermolecular bonds between atoms changes.
Simplified: The reason is that during heat transfer, the energy that is stored in the intermolecular bonds between atoms changes.