The atmosphere is just the gases surrounding Earth or any other planet in the form of layers. What keeps these layers intact is the gravity of a planet. When the planets were forming, the gases being released from volcanic activity and interior of planets led to the formation of the atmosphere of the planets which…