Smaller molecules, which are more likely to be gasses at lower temperatures, are more easily knocked away, especially from the smaller bodies. They are pushed outward to cooler regions of the solar system where the force of the solar wind is less, and condense wherever they come in contact with other matter. "Condensing", in the general sense, includes recombining, for instance, Hydrogen and Oxygen into H2O, and then joining with other molecules to form ice. The more volatile materials go further out before they condense. There may be fairly separate rings consisting mainly of condensed H2O, HCN, CO2, NH3, CH4 etc. (If you don't know what they are, don't worry about it.) Possibly Oxygen and Nitrogen condense further out. Perhaps much of what was once the atmosphere of the inner planets is out beyond Pluto in the form of comets. When something disturbs these mostly microscopic hailstones, they may develop orbits which repeatedly bring them in close to the sun. Water requires especially large amounts of energy to convert it from ice to gas, so it lasts longer in our overheated regions. So we see the comets as composed of ice because the other materials evaporate much more quickly. When comets evaporate, the gasses again condense further out.
(This suggests that the planets had to have condensed before the solar wind really got started, so gravity could hold, and for a while, "protect" much material that would otherwise be further out.) A star that develops without planets would create comet/planets from condensed solar wind, but no one planet would have the diversity of components that we see on our planets.
According to this view, the material of comets, especially the halo, which is all we see, is not really as old some people suggest. Much of it is no doubt material more recently connected from the inner planets.