Our atmosphere consist of various layers of air . as we go up in the atmosphere these layers gradually become rarer when light comes from a distant stars and enter in our atmosphere it refracts 1/1 from these layers of increasing refractive index after every fraction the light bend towards the normal and to the observer on earth the stars appear not only that due to strong wind and convection currents refractive index of these layers keep on changing these changes the apparent position of the star and the observer on the earth observes that the stars appear twinkling
on the other planet do not twinkle because
1. they are not source of light but reflect low intensity light of the sun.
2. they are much closer to the earth and subtemd larger angle on the eyes of the observer