system
Given the following post, respond as if you're commenting on Reddit:
human
Why is the sun composed of just hydrogen and helium while the rest of the solar system is made predominantly of heavier elements?

If we (and the planets) are indeed made of stardust from exploded stars, why then isn't also our sun?
gpt
In terms of mass, most of the mass of the planets is also hydrogen and helium.  It's just most of that is in Jupiter and Saturn, not Earth.  The reason the inner planets lack hydrogen and helium is that their gravity is unable to hold those lighter elements, with the temperatures of the inner planets, they simply escape into space, and get blown away by the solar wind.  The colder outer planets have a high enough gravity and low enough temperatures that this doesn't happen.