Image stabilization is a family of techniques that reduce blurring associated with the motion of a camera or other imaging device during exposure. Generally, it compensates for pan and tilt of the imaging device, though electronic image stabilization can also compensate for rotation.
Optical Image Stabilization is a technique which is used to shoot longer exposures without reaching for a tripod. It works by moving lens elements to counteract wobbly hand-induced camera shake, thereby reducing blur.
OIS works by controlling the path of the image through the lens and onto the image sensor. This is done by understanding the camera’s movement using sensors such as gyroscopes, and calculating how the lens needs to move to counteract this. The lens module is then generally moved sideways or up and down, normally by using electromagnet motors. All of this happens as the image is recorded to reduce camera movement blur.
This helps greatly in photography and reduces the chances of a blurry photo.
Below is a sample shot with and without OIS :
Photo Source: New Atlas
The alternative to OIS is EIS a.k.a. Electronic Image Stabilization, which is not as good as OIS but minimizes shaky photos and videos upto some extent using electronic processing. EIS corrects the device shaking, normally resulting in noticeable image jittering within each frame of video or each still image. EIS cannot prevent blur from subject movement or extreme camera shaking, but it is engineered to minimize blur from normal handheld lens shaking.