The correct answer is:
B. the remaining materials from the sun's formation clumped together due to gravity.
This process is part of the broader theory of planetary formation known as the nebular hypothesis. After the Sun formed from a collapsing cloud of gas and dust, the leftover materials in the surrounding protoplanetary disk began to coalesce under the influence of gravity, forming the planets, moons, and other bodies in the solar system.