As a star’s light penetrates the Earth’s atmosphere, every individual stream of starlight is refracted – caused to change direction, slightly – by the various temperature and density layers in Earth’s atmosphere. You might think of it as the light travelling a zig-zag path to our eyes, instead of the straight path the light would travel if Earth didn’t have an atmosphere. This is the reason why stars twinkle