The Jovian planets (Jupiter, Saturn, Uranus, and Neptune) are the larger of the planets. They formed in the outer portion of the Solar system, distances ranging from 5 (Jupiter) to 30 (Neptune) times the Earth’s distance from the Sun. Unlike the terrestrial planets that make up our inner solar system — Mercury, Venus, Earth, and Mars the Jovian planets do not have solid surfaces. Instead, they are composed primarily of hydrogen and helium, with traces of methane, ammonia, water, and other gases. These gases are tightly compressed around relatively tiny cores of ice and rock. They have much higher masses and lower densities than the terrestrial planets.
Since these planets are relatively far from the sun, the temperature here is lower. Because of this, there were more planetesimals which resulted in larger planets. However, the greater percent of the planetesimals in the outer solar system would be composed of ices (hydrogen and helium). These ices didn’t form in the inner solar system because it is too hot there. Since different elements have different condensation temperatures, ices could not form until the particles were in a much cooler part of the disk, and therefore much further from the Sun. The temperature of the gas affects the condensation of the elements in the gas. If the gas were cooler when condensation began, particles now common in the outer solar system would also be common in the inner solar system. That is why Jovian planets are able to hold large quantities of gas.