Liquid (molten) rock material solidify as magma (within the earth)or as lava (on the surface of the earth) to form igneous rock. the expose of rock to weathering and erosion at the earth surface breaks the down into small grains producing soil.
The grain (soil) are transported by wind , water and gravity and eventually deposited as sea.This process is reffered as erosion,this sediments also deposites in layers and become compacted and cemented forming sedimentary rocks(process of formin sedimentary rocj is call Lithification).
Variation in temperature, pressure or the chemestryof the rock can cause chemical or physical changes in igneous and sedimentary rocks to form Methamorphical rocks.
When expose to higher temperature,methamorphosical rock may be partially melted restarting in the creation once against , forming the igneous rock again , starting int his way the cycle all over again.