If the photons made a direct flight from the core to the convective zone, it would only take about 1.7 seconds. Inside a star, the inward force of gravity is balanced by the outward force of pressure. Main sequence stars are stable in size, neither expanding nor contracting. At every point in the star, the inward force of gravity is precisely balanced by the outward force of pressure. This balance between gravity and pressure is called hydrostatic equilibrium .
Pressure is proportional to density times temperature.
At the center of a star, pressure is very high. It has to be, in order to support the crushing weight of all the matter above it. The pressure is high because the density and temperature are high. The star is stabilized by a pressure-temperature thermostat. What prevents a fusion runaway is the fact that the relation among pressure , temperature , and fusion rate creates a natural thermostat.