In the first fractions of seconds, there were fields (such as the Higgs field) that were fluctuating wildly (think of it as Heisenberg Uncertainly - writ large). Once the universe had expanded past a certain point, the field "froze" at a specific level. It could have frozen at any level. The thing is, it did not freeze at zero, as it would have if the expansion had been slower.
Once this value was fixed, it determined how all or most of the properties of universe would manifest later on.
For example, if the value had frozen at any other level, matter might have no mass (it is speculated that the very property of mass itself is merely "drag" through this Higgs field), protons might not get glued to neutrons, electrons might not orbit nuclei, gravity might not work.
This why one of the arguments of the Anthropic Principle (I don't remember if it's the 'weak' one or the 'strong' one): our universe is exquisitely
tuned. Any other values for some of the fundamental constants and our universe wouldn't even have atoms - let alone life.