All particles have energy, and the energy varies depending on the temperature the sample of matter is in, which determines if the substance is a solid, liquid, or gas. Solid particles have the least amount of energy, and gas particles have the greatest amount of energy.
The temperature of a substance is a measure of the average kinetic energy of the particles. A change in phase may occur when the energy of the particles is changed.
temparature or heat is responsible for that energy