Most of the mass of a rocket on its launching pad is of the fuel. The whole of the fuel is eventually burnt and ejected from the nozzle of the rocket engine.
The burnt fuel which appears in the form of hot and highly compressed gases escapes through the nozzle (action) in the backward direction. The escaping gases push the rocket forward (reaction) with the same force and hence a upward thrust is applied on the rocket.
Due to which, the rocket moves and accelerates at a much higher value than the acceleration due to gravity and hence overcomes the gravitational pull of the earth.