After [[Smaller Non-Planetary Bodies#Planetesimals|planetesimals]] develop their rocky/icy cores and grow large enough, gravity will pull in any nearby material (mostly gases) allowing them to develop a gaseous envelope around the core of the planet. This leads to the development of [[Planetary Classes#Gas Giants|Gas Giants]] and [[Planetary Classes#Ice Giants|Ice Giants]]