Answer: (2) refraction of light by different layers of varying refractive indices
The refraction of light by various layers of different refractive indices is the explanation for the twinkling of stars. A star doesn’t necessarily twinkle when we see that from the surface. It always emits light, but our environment allows it to seem like a twinkle. With different refractive indexes, our atmosphere has different layers.
When light hits the earth’s atmosphere from a distance, it begins to refract the light into any layer that reaches. That’s why we see the twinkling of stars.