 There is an expected difference between how this works out for planets forming in the inner parts of a solar system, and how it works out for planets forming in the outer parts of the solar system. In the inner parts closer to the central star, it's hot. At these temperatures, with no pressure, water molecules cannot take liquid or solid form. The solar wind from the forming star pushes these molecules along with helium and hydrogen molecules into the outer solar system. Planetesimals in this inner region wind up with little to no gas or water. That leaves metal and rock for these planets. In the outer parts, further from the central star, the water is frozen solid, and therefore behaves like rocks. Planets out here have metal, rocks, and ice. This means that they're substantially more massive. This extra mass produces enough gravity to hold on to the gas as well. The dividing line is called the frost line, or the snow line, and its distance from the star is temperature dependent. It will be located where the temperature falls to around 250 degrees Kelvin. That's minus 10 degrees Fahrenheit. The hotter the star, the further out this line will be. This explains the difference between the rocky planets in the inner solar system and the gas giant planets in the outer solar system. Our frost line is between four and five astronomical units. That puts it at the far rim of the asteroid belt.