>>12464155I don't know if the number of planets can be traced back to something, but I can explain the gas/rocky thing and their masses. Sorry if I make some grammatical errors.
To make it simple, the radial distance from the star is strictly related to the nature of the materials that are in a solid state in that orbit. While the star rotates with the cloud of materials that are going to form the planets, this cloud is going to collapse in a disk whose axis of rotation is determined by the star's rotation axis which is determined by the initial angular momentum of the cloud; while it collapses the cloud is heating up from the center to the outer orbits. This means that there's going to be regions of the cloud with different temperatures, ranging from VERY hot to cold as fuck. The nearest protoplanets are gonna be made of metals and silicates which are the materials with the highest fusion temperature, while the outer planets (the ones placed further than the zerocelsius-orbit) are gonna be made also of materials whose fusion temperature is lower, like gasses in general.
Now the mass. The cloud is formed from dead star materials, so mainly H and He while metals and silicates are roughly 1% of the cloud. This means that the outer gassy planets are gonna be massive relative to the inner rocky ones.
This is what I remember from my "Fundamentals of Astronomy and Astrophysics" course, if someone knows more I'd be glad if you corrected me.