Scientists believe that the solar system was formed when a cloud of gas and dust in space was disturbed, maybe by the supernova of a nearby star. Shock waves from the explosion compressed the cloud of gas and dust. Compression made the cloud collapse, as gravity pulled the gas and dust together, forming a solar nebula.