The immersion oil has the same refractive index as the glass lens and the glass slide. This prevents distortion because the light waves follow a homogeneous path.