Citation Ten - Good day to you. I don't know the answer to your first question but I think your second question is referring to a phenomenon called "scintillation".
It happens when you are looking at distant lights or perhaps stars through layers of air having different densities. The apparent brilliance, colour and position of the lights or stars undergo variations because of fluctuations in the refractive index in the portions of the atmosphere through which the rays of light are passing. The eye perceives this as the lights or stars twinkling.