How does stars twinkle

"Stars appear to twinkle when light from the stars travel through different turbulent layers of the atmosphere, causing light to bend and appear to move in and out of sight"

The apparent change in brightness or position of a star when viewed through the atmosphere from the surface of the earth is commonly termed as twinkling or stellar scintillation. When light travels from one meduim with a particular refractive index to another meduim with a different refractive index, the phase velocity of light changes and as a result causes its direction of travel to change. This phenomenon is called refraction.

The earth's atmosphere is composed of many layers of turbulent air. These churning layers of air have different temperature, humidity and desity, and thus each layer has a different refractive index. Due to the turbulent nature of these layers, the light from the stars appears to move in and out of sight. These random changes in direction of light from the stars are percieved as twinking by the human eye. 

However planets do not seem to blink like stars, because even though planets may seem like point like objects, in reality the planets are much more closer to the earth compared to stars. As a result the refractive effects of the atmosphere are canceled out to a large extend and they appear to be steady