The answer is; refraction.
When waves, including light, pass through two media with different densities, the waves bend at the transition between the two media due to differences in speed and wavelength. Convex lenses bend (refract) light and concentrate it at one point called the focal point.