A star spends the majority of its life on the main sequence. Here it exists in a state of balance. The force of gravity draws ever inwards, the sum of particles attracting each other towards the centre of the sphere. Resisting gravity is the random motions of the gases and radiation, the pressure. If is the gravitational potential energy, P the pressure, and V volume, the Virial Theorem gives the following relationship:
In a non degenerate gas, the pressure is temperature dependant, for an ideal gas,
where T is the temperature of the gas, and R the ideal gas constant. While the initial input of energy comes from the gravitational collapse of the protostar, it is maintained by the nuclear fusion reactions that occur within the core.
The higher the atomic number of an element, the more energy required to create that element by fusion reactions. As noted previously, this can occur for elements up to Fe56, although not all stars reach this stage in nucleosynthesis. When enough of the fuel in the core is burnt the nuclear reactions can no longer proceed, and the core becomes degenerate.