Simple: Gravity.
The distribution of energy (and therefore matter) wasn't even during the big bang, resulting in a universe filled with "filaments" of matter. Our galaxy is part of a cluster called the Local Group, which is itself a part of an even larger group of 100 or so clusters called the Virgo Supercluster.
Basically put, everything in the Virgo Supercluster was blown in roughly the same direction at about the same velocity by the big bang...we're all going in the same direction (there ARE other superclusters going in other directions). Now, all of our galaxies, clusters, and superclusters have gravity wells and are attracted to each other. If they're close enough, like the Milky Way and Andromeda are, that attraction can alter their courses enough to cause a collision. Andromeda and MW ARE going in the same direction but, thanks to gravity, our paths will cross in a few billion years.
"First the was nothing and then it exploded".
Right.
The distribution of energy (and therefore matter) wasn't even[uniform?] during the big bang, resulting in a universe filled with "filaments" of matter.
Is this also a theory based on another, the big bang theory? IMHO, it doesn't seem to fit a simple intuitive model. That is, presumably EVERYTHING in the universe is steadily moving away from everything else(BTW, is this also theory?), ergo, the gravity wells(another theory?) you mention should be losing strength instead of gaining strength.
It just seems logical to me that if in fact the universe is continually expanding, as it might very well be, the chances of collisions become less, not greater. But, I'm not in the field and never have been; it's just a matter of curiosity that I haven't ran across an acceptable explanation to.
FGS
that is an interesting line of thought, but is it supported mathematically?