Light refraction by several layers of the atmosphere with differing refractive indices causes the twinkling of stars.
When light from afar strikes the earth's atmosphere, it refracts into each layer that it reaches. The twinkling of stars is due to this.
Planets are significantly closer to the earth than stars and are considered extended sources. As a result, a planet can be thought of as a collection of numerous small light sources.
Although light coming from individual point-sized sources flickers but the total amount of light entering our eye from all the individual point-sized sources average out to be constant.