Not everyone agrees, but it is generally thought that stars originate from nebulae (clouds of dust and gas). Almost inevitably, a nebula will "collapse" into a single mass because of the force of its particles' gravity.
Detail from the Orion Nebula
(Our thanks to the
STScI for the use of this image.)