All things with mass come together, or gravitate towards one another. This pulled all the gas towards the center. Eventually the pressure at the center raised the temperature so that hydrogen atoms fused together to make helium. This began the star we know as the Sun. The process by which solar systems are created is called "the nebular theory". 