As the nozzle is moved, the direction of the thrust is changed relative to the center of gravity of the rocket.
If the nozzle is gimbaled back along the center line, the rocket will move to the left.
This involves moving the entire combustion chamber and outer engine bell as on the Titan II's twin first-stage motors, or even the entire engine assembly including the related fuel and oxidizer pumps.
[1] A later method developed for solid propellant ballistic missiles achieves thrust vectoring by deflecting only the nozzle of the rocket using electric actuators or hydraulic cylinders.
The nozzle is attached to the missile via a ball joint with a hole in the centre, or a flexible seal made of a thermally resistant material, the latter generally requiring more torque and a higher power actuation system.