1. Gravity: Gravity pulls all the matter in the star inward towards its center. This force is constantly trying to crush the star.
2. Nuclear Fusion: At the core of a star, nuclear fusion reactions occur, releasing tremendous amounts of energy. This outward pressure pushes against gravity, preventing the star from collapsing.
These two forces are in a delicate balance. If gravity were stronger, the star would collapse. If nuclear fusion were stronger, the star would expand. This balance is what keeps a star stable for a long period of time.