Magma is the term that is used to call molten rocks that resides deep within the earth. It is composed of crystals, particles of rock, liquids and different types of gas. The reason that magma rises to the earth is that its weight is lesser than the hard rocks that surround it and also the extreme temperature underneath the earth forces it to rise upward.
When magma is forced to rise due to the reasons mentioned above, it exerts pressure on the weak spots of the crust. It fills up the cracks that were produced by the shifting of the earth’s crust and when the pressure has risen too much, it will force itself upwards and erupt as lava.