Final answer:
A star remains in equilibrium when the inward force of gravity is balanced by the outward force of gas pressure, a state known as hydrostatic equilibrium.
Step-by-step explanation:
The two forces that must be in balance to keep a star in equilibrium are gravity and the outward force of gas pressure. This state of balance is known as hydrostatic equilibrium. Gravity works to pull the star's material inward towards its center, while the gas pressure, which is the result of nuclear fusion occurring in the star's core, exerts an outward force. These two forces counteract each other, and when they are equal, the star is stable. Main-sequence stars, such as our Sun, maintain this balance throughout most of their lifetimes, burning hydrogen into helium. The stability of main-sequence stars can be examined on a Hertzsprung-Russell (H-R) diagram, which reflects the relationship between the star's luminosity and its temperature.