Optical Image Stabilization in a smartphone uses a gyroscope to measure the amount and direction of handshake from the user. The driver chip reads the signal from the gyroscope and calculates how much to move the actuator. The driver then sends the correct current to the actuator to move the lens stack accordingly to compensate for the handshake and to keep the image stationary on the image sensor. OIS has been used for several years in digital still cameras and is now becoming popular in smartphones.
The optical axis (image position) is centered on the image sensor and since there is no movement the image is stationary relative to the sensor and the captured picture is sharp.
The optical axis (image) moves relative to the sensor causing the image to shift during capture which in turn results in a poor quality, blurry image.
The OIS actuator moves the lenses to compensate for handshake, which keeps the optical axis (image) centered (stationary) on the image sensor. The red line shows where the image would be without OIS and the green with.