* Distance from the Sun: The inner planets are much closer to the Sun than the outer planets. The Sun's heat and solar wind pushed away lighter elements like hydrogen and helium, making it harder for them to accumulate near the inner planets.
* Smaller gravitational pull: The inner planets are much smaller than the gas giants. This means they have less gravity, making it harder to hold onto the lighter elements.
* Timeframe: The inner planets formed earlier than the gas giants. This means that they had less time to accumulate gas before the Sun's heat and solar wind cleared out the protoplanetary disk.
In contrast, the gas giants formed further out from the Sun where it was cooler and their gravity was stronger, allowing them to hold onto lighter elements like hydrogen and helium.
Essentially, it was a combination of the Sun's heat, the inner planets' smaller size and weaker gravity, and the timing of their formation that led to the differences in composition between the inner and outer planets.