Rockets range in size from small fireworks that ordinary people use to the enormous Saturn V that once propelled massive payloads toward the Moon. The propulsion of all rockets, jet engines, deflating balloons, and even squids and octopuses are explained by the same physical principle: Newton's third law of motion. The matter is forcefully ejected from a system, producing an equal and opposite reaction on what remains.
The motion of a rocket in space changes its velocity (and hence its momentum) by ejecting burned fuel gases, causing it to accelerate in the opposite direction of the velocity of the ejected fuel. Due to conservation of momentum, the rocket's momentum changes by the same amount (with the opposite sign) as the ejected gases. However, in the presence of a gravitational field, the momentum of the entire system decreases by the gravitational force acting on the rocket for a small time interval, producing a negative impulse. Remember that impulse is the net external force on a system multiplied by the time interval, and it equals the change in momentum of the system. Using the principle of momentum conservation, the velocity of a rocket moving under gravitational force at any given instant can be calculated using the ideal rocket equation.