Vibration Reduction aka VR, works on the principle of counteracting motion. There are Gyroscopes mounted within the VR lenses, this device is capable of detecting pitch, roll and yaw, commonly used in aircrafts and helicopters. Traditional implementations of gyroscopes involves a rotating disc or mass where the centrifugal force is balanced from the axis where it is spinning on. Modern gyroscopes are implemented electronically rather than mechanical form.
When VR is activated, the gyroscope mounted within the lens detects movements at fast and regular intervals. The movement differences are used to control actuators within the lenses to counteract your motion and keep the image stable.
The "brain" that controls how much to counteract makes use of algorithms commonly used in the field of control engineering such as "Proportional, Integral and Differential Control" aka PID and training via Neural Nets. Such algorithms are intelligent enough to compensate and sometimes even predict behaviour and compensate in advance.
When you make use of VR, you do note that there is a settling time when your VR kicks in on 1/2 depressing the shutter. So don't just snap away immediately. Hope this helps