because a rocket makes an explosion that is stopped at one end and so can only go the other way. one of the laws of physics is every action has an equal and opposite reaction which, in this case, moves the rocket.
One word: thrust, when gas is propelled out the back of the rocket it provides the amount of thrust needed to propel the rocket forward.