Gravity pulls it inwards. Heat from fusion in its core pushes outwards.
In stars far heavier than the Sun, the core is crushed and the rest explodes.
Inside the event horizon, gravity is so strong that nothing gets back out.
Packed that tightly, even the Sun would become a black hole.