Stars that are one-third to eight times the mass of the Sun (including the Sun) eventually evolve into red giants. (The Sun is thought to be a red giant in 5 billion years) As it expands a lot in this state, the outer layers of the atmosphere of the red giants will escape gravity and slowly fall off. These falling layers of gas slowly expand around the star in a spherical shape. These layers are what we call the planetary nebula. After the red giant, the star in the center will turn into a white dwarf
Stellar nebulae are the places where stars are born in the universe. The nebula is made up of dust particles and vapors. Over time, due to gravity, they come closer and the stars are born … and thus a beautiful universe.