Exploratour - Evolution of the Solar System
As shown in this picture, while they were forming in the flattened disc of the solar nebula, the core of the planets-to-be drew material to themselves from the cloud of gas and dust around them. The bigger planets-to-be were able to draw even more material unto themselves because of gravity.
This is page 8 of 60