Planets form from the debris disk of gas and dust around a young star. Where they form determines how large they grow initially, but migration can have further effects on size.
NASA/JPL-Caltech