Passage: Nearly all small and intermediate-mass stars (below about 9 M☉) will end up as white dwarfs once they have exhausted their supply of thermonuclear fuel. Such stars spend most of their energy-producing life span as a main-sequence star. The time that a star spends on the main sequence depends primarily on its mass, with the lifespan decreasing with increasing mass. Thus, for IK Pegasi B to have become a white dwarf before component A, it must once have been more massive than component A. In fact, the progenitor of IK Pegasi B is thought to have had a mass between 5 and 8 M☉.As the hydrogen fuel at the core of the progenitor of IK Pegasi B was consumed, it evolved into a red giant. The inner core contracted until hydrogen burning commenced in a shell surrounding the helium core. To compensate for the temperature increase, the outer envelope expanded to many times the radius it possessed as a main sequence star. When the core reached a temperature and density where helium could start to undergo fusion this star contracted and became what is termed a horizontal branch star. That is, it belonged to a group of stars that fall upon a roughly horizontal line on the H-R diagram. The fusion of helium formed an inert core of carbon and oxygen. When helium was exhausted in the core a helium-burning shell formed in addition to the hydrogen-burning one and the star moved to what astronomers term the asymptotic giant branch, or AGB. (This is a track leading to the upper-right corner of the H-R diagram.) If the star had sufficient mass, in time carbon fusion could begin in the core, producing oxygen, neon and magnesium.The outer envelope of a red giant or AGB star can expand to several hundred times the radius of the Sun, occupying a radius of about 5 × 108 km (3 AU) in the case of the pulsating AGB star Mira. This is well beyond the current average separation between the two stars in IK Pegasi, so during this time period the two stars shared a common envelope. As a result, the outer atmosphere of IK Pegasi A may have...

Question: How did it compensate for the increase in temperature?
the outer envelope expanded to many times the radius