Once all nuclear energy has been exhausted, the star itself collapses, and a densely packed star called a white dwarf results. As the process continues, the star collapses to the neutron stage, the star's electrons are absorbed into its atomic nucleus, and surface explosions occur. The result is the ephemeral brilliance of a supernova. There is a lot of hydrogen in space, and there is a lot of dust. Sometimes, hydrogen and dust come together to form stars.
Astronomers think that gravity does.
As you know, gravity acts like a magnet. For example, if you throw a ball into the air, gravity will pull it back to earth. In the same way, gravity pulls hydrogen and dust together. If there is a lot of dust, gravity is more powerful. If there is a lot of hydrogen nearby, gravity is even more powerful.