system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: Stars blinking

Does anyone know why stars blink as they do? I would love to know as I have always loved looking up onto the skys. and this questing always comes up.
gpt
The atmosphere consists of many many layers of air "pockets", and these pockets are constantly moving around in the atmosphere. What makes each pocket different from another is that they have slightly different temperatures and densities.

Here's why that's important: if you've ever looked at a straw in a glass of water, you've seen how it appears to be bent, even though you know the straw is straight. This is a result of an effect called 'refraction'. Essentially, light moves and different speeds in materials with different densities. To understand why this causes refraction, imagine if you were running with a bunch of your friends in a straight line, shoulder to shoulder. If people at one end of the line started slowing down, then the people at the other end would start moving past them, and your line would slowly wheel and change direction. Well, when the leading edge of the light ray hits the water, a similar effect happens, and the light ray "bends" and changes direction.

Just like with the water in the glass, light moves at different speeds through the different pockets of air, and so every time a light ray moves through a pocket, it changes direction slightly.

Now because those air pockets are all moving around, sometimes a bunch of light rays from a star get bent toward your eye, and the star appears brighter. Then the air pockets move around some more, and now most of the light rays from the star are being bent away from your eye, so the star appears dimmer. This constant brightening and dimming of the star is what we call "twinkling".

This also explains why the planets in our solar system don''t appear to twinkle: stars are so very far away from us that they are just tiny little pinpricks of light. This means that the apparent size of a star is much smaller than the size of one of these air pockets. But the planets are much closer to us, and so their apparent size is very big--much bigger even than the size of the air pockets. So the light from a planet passes through a bunch of air pockets instead of just one at a time, and this means that even though the light from one part of the planet is getting bent away from us, the light from another part is being towards us, and so as a whole, the planet doesn't appear to get brighter and dimmer. The brightening and dimming average out, and the planet's brightness stays roughly constant, which means no twinkling!