What causes the change of state in matter?
When energy is added or subtracted , a substance's state is physically changed.
This occurrence has to do with the movement of the molecules. Solids have very little kinetic energy which means that the molecules only vibrate and maintain strong chemical bonds.
When energy is added (e.g. heat energy, that will then be transformed into kinetic energy), the molecules start moving and vibrating more causing the strength of the bonds to decrease.
When a certain amount of heat is added (this varies per substance, for water melting point is 0 degrees Celsius and boiling point is 100 degrees Celsius) the molecules would be moving to the point of no longer being in its original state.
When energy is decreased, this process is reversed.
(I hope this makes sense and answers your question :)