When the sun began its nuclear energy production, the explosion sent gases, dust, and particles flying outward.
The lightest matter, such as the gases hydrogen and helium, simply flew farther away.
The farther reaches from the Sun were not effected as much by the Sun’s heat, so the gases remained relatively inert, they didn’t change into other, heavier forms.
This matter formed the outer planets Jupiter, Saturn, Uranus, and Neptune, which are also known as the gas giants.
A gas giant is sometimes called a Jovian planet after the planet Jupiter.
Heavier material, which didn’t travel so far, and so reacted in part to the higher temperatures nearer the Sun, helped to create the inner planets, also known as the terrestrial, or earth-like, planets.