A: Planets and their atmospheres come from the same material as their parent star, which forms from a nebula of dust and gas. After the new sun ignites, excess material that didn't make it into the star instead forms a disk around it. Planets, asteroids, and comets later condense from that disk.
Why do we have atmospheres?
The atmosphere protects life on earth by shielding it from incoming ultraviolet (UV) radiation, keeping the planet warm through insulation, and preventing extremes between day and night temperatures. The sun heats layers of the atmosphere causing it to convect driving air movement and weather patterns around the world.
Why does the earth have an atmosphere while other planets don t?
A large planet such as Jupiter has enough gravity to hold on to most of its hydrogen and helium, which is why these elements dominate the atmospheres of gas giants. But the gravity of Earth isn't strong enough, so Earth's early atmosphere of helium and free hydrogen evaporated into space.