The particles gain energy meaning they can for example turn it into kinetic energy which makes the particles vibrate- eg. when you heat ice (adding thermal energy) the water molecules in the ice vibrate causing them to break a part meaning the ice melts into liquid water