so take water for example, water has a melting point and a boiling point right? So if it's below 0 degrees, then it's in its solid phase. If the temperature is above 0 degrees, then the water starts to melt into its liquid phase. Then when the temperature is above 100 degrees, water starts to boil and become its gas phase. This is the same for all substances. The only difference is different substances have different melting and boiling points so the numbers will be different depending on your substance. hope this helped!
Explanation: it occurs when the adhesion forces (attraction between two surfaces or substances) in the liquid are stronger than the cohesion forces (attraction between the same molecule)