The changes that stars undergo is referred to by astronomers as stellar evolution.
Physical laws dictate a star's structure and composition.
For example, gravity pushes together dust and gas clouds to form and hold together a star. Resistance against gravity is provided by the pressure of the compressed gases in the core. A star continually emits heat and radiation, which must be replenished or else the star will collapse. The star produces the necessary energy through nuclear fusion of hydrogen within the core. It eventually consumes the hydrogen in the core, and the star changes its structure by swelling into a red giant.