 The interior of a stable star is in a state of hydrostatic equilibrium : the forces on any small volume almost exactly counterbalance each other . The balanced forces are inward gravitational force and an outward force due to the pressure gradient within the star . The pressure gradient is established by the temperature gradient of the plasma ; the outer part of the star is cooler than the core . The temperature at the core of a main sequence or giant star is at least on the order of 107 K. The resulting temperature and pressure at the hydrogen @-@ burning core of a main sequence star are sufficient for nuclear fusion to occur and for sufficient energy to be produced to prevent further collapse of the star . 
