As it does so the centre is squeezed tighter and it gets hotter. More heat is made from the nuclear furnace. This heat cannot get out quickly enough so the outer layers of the star expands. As a result of this changing some stars actually change their brightness over the same range of time. Many stars seem to come in pairs, like twins.
Some stars even come in triplets or quadruplets.
Even though these twin or triplets were formed at the same time, they're often very different. Sometimes a giant orange star is twinned with a mediium sized blue star. Sometimes a yellow star like our sun is matched with a white dwarf. Twin stars dance with each other. If one star is heavier than the other, the lighter one will orbit the heavier one.