Just as during formation, when the material contracts, the temperature and pressure increase. This newly generated heat temporarily counteracts the force of gravity, and the outer layers of the star are now pushed outward ( in not sure tho ) I hope this helps