The structure of a main-sequence star is quite simple: at the core of the star, hydrogen is converted into helium through nuclear fusion. Some of this nuclear energy escapes directly into space as neutrinos, and the remainder is trapped within the core as thermal energy and electromagnetic radiation. This energy is transported through lower temperature and density layers to the surface.
All main sequence stars have regions that are stable to convection and regions that are unstable. A star with a mass about the size of the Sun or less has a core that is stable to convection, but its outer layers are unstable. The distance of the boundary between the convective and the stable layers from the center of the star depends on the mass of the star, with the boundary closer to the center in smaller stars. The very smallest stars are fully convective. Stars the size of the Sun are convective in only the outermost layers. Because of the stability of their cores, stars the size of the Sun and most stars that are smaller have no mixing of the fusion-created helium with the hydrogen outside of their cores. This leads over time to a composition gradient within the cores of small stars, with the very center of the star becoming helium-rich, and region immediately outside of the core remaining hydrogen-rich.
Stars that are more massive than the Sun have an outer layer that is stable to convection and a core that is unstable; the boundary between these two layers moves outward towards the surface as the mass of the star increases, but it never reaches the surface. Because of this convective interior, the helium created through nuclear fusion is carried out of the core, and hydrogen from regions outside of the core is carried into the core, where it undergoes fusion. This causes a massive main-sequence star to convert more of hydrogen into helium than is present within its core. Over time, the boundary between the convective interior and the stable outer layers pulls closer to the center of the stars. This leads to a composition gradient, similar to that produced in a low-mass star, but extending out to larger radii.
The size of a star's core is set by the star's mass and core temperature. The larger the mass, the larger the core, but the larger the core temperature, the smaller the core. This last point may at first appear counterintuitive. Keep in mind that we are considering stars in static equilibrium, so the pressure at the core of a star must be counteracted by the gravitational force on the core by the overlaying material. At the core radius, the gravitational force is proportional to the mass of the core divided by the square of the core radius. If the mass of the star is held constant, the gravitational force at the core can only be increased by shrinking the core.
The mechanism that transports radiation out of a star and the nature of the pressure within a star, whether dominated by radiation pressure or gas pressure, determines the precise structure and radius of a star. Because these factors change with mass, there is no simple equation that relates the stellar mass and core temperature to the surface radius and temperature. If a star is fully convective and dominated by gas pressure, or if it is fully supported by radiation pressure, then the radius of a star is proportional to the radius of its core, and the surface temperature is proportional to the core temperature.
By defining the mass and the core temperature of a star, we can calculate a structure for the star. But the core temperature is not an arbitrary parameter; its value adjusts until the rate of energy generation though nuclear fusion equals the rate of energy loss at the star's surface. The nuclear reaction rates are strong functions of temperature, with the rate rising rapidly with temperature. They are also proportional to the square of the density. This means that as the core of a star shrinks, both the density and the temperature increase, and the rate of nuclear fusion increases dramatically. Because the core density is inversely-proportional to the cube of the core radius, and because the core temperature increases inversely with core radius, the nuclear reaction rate increases faster than Rc-6. The surface temperature of the star increases proportionally with the core temperature as long as the character of the energy transport and of the pressure do not change. The surface radius is then proportional to the core radius, and the surface temperature is proportional to the core temperature. Because the cooling at the surface is proportional to R2T4, a feature of thermal cooling, and because the core temperature is inversely proportional to the core radius, the cooling rate increases as the star shrinks as Rc-2. The energy generation at the core therefore increases much more rapidly than the energy loss at the surface, and so as the star shrinks, it finds a core temperature that balances heat generation with cooling.
In practice, because the energy generation rate is such a strong function of temperature, the core temperature of a star is a weak function of its mass. A star of one-tenth the Sun's mass will have a core temperature of around 4 million degrees, and a star with 50 times the Sun's mass will have a core temperature of around 40 million degrees. So over a mass range of a factor of 500, the core temperature increases by only a factor of 10. The core temperature determines which of the two hydrogen fusion processes, the PP chain and the CNO cycle, is dominant. The PP chain dominates energy production in stars of less than one-third of the Sun's mass. The CNO cycle dominates in stars with more than 1.3 time the Sun's mass.