The formation of elements by the sun is caused because of something called nuclear fusion. Nuclear fusion is when the sun has two hydrogen atoms and combines them together creating hilum the more it combines the more heavier the element it also makes energy as it combines the elements together. When the sun creates iron it stops because it doesn’t have enough energy to combined iron atoms together. Then it repeats this prosses over and over until it has to much iron and it explodes we call the explosion a supernova.
