The Earth's atmosphere is very unstable and in turbulent conditions at altitude, breaks into "cells" of varying density. These cells refract the starlight differently and the net result is a flashing sparkling star image. Each image is in effect a small spectrum or rainbow of light which the atmosphere sweeps backward and forward across you eye giving rapidly changing colours. The combined effect of many such cells in the line of sight towards a star gives it a very complex twinkling of all the colours of the rainbow. It is more noticeable for stars at low elevations as we are then looking through a greater path-length in the Earth's atmosphere.

When you look through a large telescope at the star image, the combined effect over a larger diameter path makes the star fuzz up into a blur. Astronomers refer to this as bad "seeing".