Here's why:
* Hydrogen is the most abundant element in the universe. It's the fuel for nuclear fusion, the process that powers stars.
* Helium is created as a byproduct of nuclear fusion. As stars age, they fuse more hydrogen into helium, which becomes a larger proportion of their composition.
While these are the two primary components, stars also contain trace amounts of other elements, often referred to as "metals" in astronomy.