the heat produced in fusion process makes the stars expand through thermal pressure. gravitational attraction is pulling the mass of the star inwards. in a stable star, thermal expansion and gravitational attraction are equal so the star remains the same size. this balance can change later in a stars life when a great increase in thermal pressure can cause it to expand