Actually, one does not ask such a question of physics, because physics is more concerned with THE HOW and philosophy with the WHY.But I think you’re asking about the cause:
According to the standard model of physics, the universe was created with a bang and this model is unsuitable to explain the formation of matter plausibly:
(a) is not defined which components the matter consists of
In the standard model, the causes of interactions are missing, because only one direction of movement to the outside is possible for the expansion behavior and thus any encounter of the components of matter is impossible.
So the standard model can’t really explain it to you, but I’m able to give you my own answer.
I quote from my blog:
In the article My Universe I describe:
The cause of encountered directions (collisions) lies in the center, where the end of all curvatures brings everything together again – it pops forever.
The individual orbital orbits vectorially determine the direction and relative velocity of matter.
For example, if two objects are on a collision course of almost 180掳, this can lead to a reciprocal circid.
In the image, the black arrows represent the gravitational effects and the red arrows represent the electromagnetic effects.
The red arrows are to be understood as the known magnetic field lines. In the centre, it is easy to see how the contrasting polarity provides distance, with gravity ensuring cohesion.