[Physics] Why is the Sun made of light elements only

astrophysicsmetallicitystarsstellar-physicssun

Since the entire solar system inherits its heavy elements from supernovae unrelated to our star, I fail to understand why, while capturing most of said system's matter, the sun only contain light elements, especially hydrogen, selecting out heavy elements found in the rest of the system, especially rocky planets like earth.

EDIT: so reading the answer offered by G. Smith it appears my initial question title is wrong, because the Sun does contain heavier elements. Not sure if I should correct it afterwards or leave it for historical reasons.

Best Answer

The Sun didn’t “select out” heavy elements from the cloud. The planets selected out light elements because they don’t have enough gravity to hold on to their hydrogen and helium.

Source: http://curious.astro.cornell.edu/our-solar-system/53-our-solar-system/the-sun/composition/201-does-the-sun-have-any-heavy-elements-beginner