Answer:
Gravity
Step-by-step explanation:
While a star is on the main sequence, its equilibrium is the result of the outward pressure of hot gas and the inward pressure of GRAVITY.
Gravity is a property of mass of objects. Pressure gravity is the resultant force felt by a particular mass object.
As gravity contact the star surface, density gradient is set up.
Pressure of gravity is a gravitational compression which increases the objects density, compresses the mass of objects and reduces the object's size.
A star might leave the sequence if the star run out of fuel for nuclear fusion in its core.