1 Stars generate energy through nuclear fusion in their cores, which counteracts the inward pull of gravity.
“Therefore, only by colliding nuclei together and fusing them in its ultra-hot core can a star release enough outward energy to counter the effects of gravity relentlessly crushing inward.”