This is possible because when a star dies, it basically expands to its maximum (explodes). Therefore, the materials of the exploded star mix with the primeval hydrogen of the Universe. Later, other stars are formed out of this mixture. Thats also how the sun was formed. :)
Answer:
Volcanic degassing of volatiles, including water vapour, occurred during the early stages of crustal formation and gave rise to the atmosphere. When the surface of Earth had cooled to below 100 °C (212 °F), the hot water vapour in the atmosphere would have condensed to form the early oceans.
Explanation: