The inner planets are small and rocky, and the outer planets are mostly large and gaseous because the Sun's gravity caused the denser rock and metals to settle towards the center of the solar system, while the lighter materials remained farther from the Sun. The spin of the disk caused the denser rock and metals to remain towards the center of the solar system, while the lighter material was flung farther from the Sun. Hydrogen is more abundant than rocks and metals, so beyond the frost line, hydrogen froze to form the jovian planets. Hydrogen compounds are more abundant than rocks and metals, so beyond the frost line, the gravity of large ice planetesimals could capture the abundant light gases.