Entire stars and our own Sun is just an example, are warm balls of lustrous plasma held together by their specific gravity. And the gravity of a star is very strong. Stars have continuously collided themselves inward, and the gravitational friction of this causes their interiors to heat up. A star like the Sun is only 9980.33 Fahrenheit at its surface, but at its core, it can be 26999540.33 Fahrenheit.
The extreme pressure and temperature at the core of a star allow nuclear fusion reactions to take place. This is where atoms of hydrogen are fused into atoms of helium (through numerous stages). This reaction releases a huge amount of energy in the form of gamma rays. These gamma rays are entrapped inside the star, and they push outward against the gravitational compression of the star. That’s why stars hold to a certain size and don’t continue producing.
If you want to read the full article then click here.