Refraction causes a straw to appear bent when it is placed partly in a glass of water. The effect occurs because light changes speed and direction as it passes between water and air, so the submerged section appears to come from a different position.
Water has a refractive index of about 1.33, compared with roughly 1.00 for air. Light rays leaving the water bend at the surface before reaching the observer's eyes. The brain normally assumes that light has traveled in straight lines, so it traces those rays backward and places the underwater part higher or sideways from its true location.
The same principle makes a pencil look broken in a glass, makes swimming pools appear shallower than they are, and allows lenses to focus light. The angle change is described quantitatively by Snell's law, which relates the angles of incidence and refraction to the materials' refractive indices.
Refraction is different from reflection, where light bounces off a surface. Dispersion is a related effect in which different wavelengths bend by different amounts, producing color separation such as a rainbow.