This types of rocks, when slowly get old and aged, they are covered with more silt(the sand and clay particles carried by river) and the silt above turns to sedimentary rocks, as well. Like this, the initial rock gets more and pressurized, and it also gets heated when it gets underground. For this , they turn into Metamorphic Rock, but this process is way way slow.
This metamorphic rocks, if go very deep because of the pressure, it could get heated enough to melt and form magma. This magma can come out of various cracks on earth's surfaces, or by volcanoes as lava.
This lava , when comes in contact with air, it rapidly cools and forms Igneous Rocks.
Hope this helps.