Here's why:
* Gravity: The collapse was driven by gravity, pulling all the matter in the nebula towards the center.
* Compression: As the matter fell inwards, it compressed, squeezing the particles closer together.
* Friction: The friction between the particles generated immense heat.
This combination of heat and density eventually led to the ignition of nuclear fusion in the core, creating our Sun.