The birth of a star occurs when when a nebula starts to contract (and not to expand). Due to gravitational instabilities, the nebula can fragment into smaller pieces that, in turn, can also collapse and continue to divide, eventually forming tens or hundreds of stars. As they start to contract, these fragments start a heating phase and are called protostars. When the temperature in the center of the fragments reaches a value high enough to start the nuclear fusion reaction, the contraction stops and the star is born.