While this might seem like a simple question to answer, it has puzzled parents of curious children for ages. The answer can be a bit long-winded. The Earth’s atmosphere is made up of gases and a scattering of water and solid particles. As light from the Sun enters the atmosphere, most of it passes straight through the air, but some of it disperses because of something called Rayleigh scattering. Shorter wavelengths of light waves in sunlight (those on the blue end of the scale) are absorbed by gas molecules and then released at different angles. Because the bluer wavelengths are scattered in this manner, this is the end of the spectrum of light that reaches people’s eyes. However, as your eye looks more and more toward the horizon, you are looking through a much thicker layer of air and less blue light reaches your eyes, which is why the sky appears bluer as you look up, but paler as you look toward the horizon.
Earth’s precious atmosphere formed over billions of years.