Atmospheric refraction causes starlight to bend as it passes through layers of air with different optical densities, leading to fluctuations in apparent brightness and position.