Why Do Stars Twinkle?

Because of the difference in densities among the layers of atmosphere, the density of the atmosphere as a whole is not consistent. The layer at a higher altitude is less cold and denser than the layer present at a lower altitude. Because of this as we go upwards, the refractive index of the atmosphere decreases.

Light of star continuously bend towards the normal until it gets to our eyes. That is why positions of these stars appear different from their actual position in the atmosphere.

Furthermore, the atmosphere is dynamic, i.e. the physical state of refractive medium keeps constantly changing every minute. This leads to a constant changing of the position of star from its actual location. It also changes its light intensity. This is what gives rise to the phenomenon called the Twinkling of Stars.

Why Stars Twinkle
Why Planets Don’t Twinkle?

The reason the planets don’t twinkle because they are much nearer to our earth as compared to stars. Thus, the stars can be looked at as a minute source of light while the planets can be considered as a collection of these minute sources that nullify each others twinkling capacity.