When Galaxies Collide
Even though there is a whole lot of empty out there in the universe, matter likes to stick together, and most galaxies are found in small to very large groups. Our own galaxy, the Milky Way, is one of the two big spiral galaxies in our Local Group, a collection of about 50 mostly much smaller galaxies. Many other galaxies belong to giant clusters that contain up to thousands of individual galaxies. The galaxies in both types of groupings are close enough together that collisions are far from rare. Our galaxy, for example, probably collided with a much smaller galaxy some 100 millions years ago or so, and expected to collide with Andromeda, the other biggie in the local group, in 3.5 billion years. Such collisions were doubtless much more common in the early universe and modern galaxies probably formed from such collisions - the original galaxies 10 billion years ago seem to have been much smaller, for example.
So how big a deal is such a collision? Even in galaxies, stars are far apart, and some calculations suggest that direct collisions of stars would be a one in a trillion event, assuming a stellar cross section of around (10^6 km)^2. Of course much less close approaches would still be hugely disruptive to planetary systems. Any approach closer than a couple of hundred astronomical units - a billion fold increase in cross section - would be pretty disruptive.
The real collisional action, though, is in the interstellar gas, which ranges in density from 1-10^4 molecules/cm^3. That's still pretty empty, even in the higher ranges. Even in one of those 10^4 mol/cm^3 molecular clouds the mean free path for a molecule is 10 million km or so. Seems like a lot, but galaxies are tens of billions of times that in dimension, so essentially every molecule will collide, usually billions of times, and at velocities of up to a million km/hr. This will produce violent shock waves. These shock wave will compress the gas, setting off a furious burst of star formations, many of which will be type O and B supergiants, destined for short violent lives and Supernova endings.
The big picture, though, is gravitational disruption of the galaxy system. Huge number of stars have their orbits violently disrupted, are dragged out of their galaxy, or hurled into intergalactic space. Of course our own personal planet will have been long fried and possibly swallowed by our by then red giant star.
Here is a simulation of such a collision:
If you want a simulation more specific to our personal situation, this simulation of the forthcoming collision is based on detailed information, including the fairly recently measure proper motion of the Andromeda galaxy - which was necessary to see that the collision will not be a glancing one. The third sort of big (1/10) our size Triangulum galaxy has a walk on part.
We probably don't need to worry about it though - our planet will have long been incinerated by the by then red giant version of the Sun - at any rate, we have a few billion years to get our affairs in order - for the galaxy collision, that is probably ony a few hundred million for the Sun to start serious cooking.