Statement one isn’t true. All galaxies are travelling away from most other galaxies, but this rule does not apply to the closest ones, since at that range the gravitational attraction between galaxies is sufficient to keep things grouped up.
The second clause of your first statement is false.
Space is expanding, while, at the same time, galaxies are moving more or less randomly within space. This means that, on average, if you take any random pair of galaxies they are more likely to be getting further away from one another than closer one another, especially if the distance between them is (by cosmic standards) large, so that there is a lot of expanding space between them already. However, there are many exceptions, especially among relatively close galaxies (who do not have all that much expanding space between them). In that case, their random motion, together with gravitational attraction between them, may well be bringing them closer.
Statement two probably isn’t entirely true, either. The Andromeda Galaxy, which is the closest major galaxy to our own, is in fact currently getting closer to us, but it’s more likely that we’ll swing past each other than it is that we’ll collide. It’s like when you’re traveling down the highway and see another car coming the other way: It’s definitely approaching you, but that doesn’t mean it’s going to hit you.
(To be completely nitpickingly correct, there are also a fair number of very small galaxies in our immediate vicinity, and we’re currently colliding with at least one of them, but they’re so small that it’s quite uneventful for us.)
Can we approximate it as an ideal gas released from its contained into a large room? The gas will tend to fill the room, and thus the space between gas particles will tend to increase, but gas particles can still ‘collide’ with each other.
Space is just so vast. The average spacing between stars is something like 2-4 light years. Our own nearest star is a little over 4 lys away, and to the human eye it’s just a tiny point of light in a sea of tiny points of light. Even if we were colliding with another large galaxy right now, all the stars would still be so far away they’d be tiny little points of light like everything else.
I think this is how astrophysicists do think about it (and they probably use virtually the same math they use for gas thermodynamics). I have a good friend who is an astrophysicist and I asked him once about what proportion of galaxies are blue-shifted (i.e., moving towards us). He said, It’s what you would expect from random motion in a gas." I got the impression it was scarcely even a metaphor for him: he thought of the galaxies in space as a gas.
Of course, the part about space itself expanding is not the same as a cloud of gas expanding to fill an evacuated room. That analogy will not get you the greater red-shifting at greater distances, but the random motion itself is very gas-like. (Except that gas molecules, if they do collide, bounce off one another, whereas galaxies tend to pass through each other, with some damage, or to coalesce.)
Imagine a huge lake (that started out much smaller) with thousands of boats cruising around on it.
There’s a deluge of water pouring into the lake from below, causing the area of the lake to expand.
The boats are going to seem to recede relative to each other, but it’s not by their own intrinsic motion, the lake is carrying all the boats away from each other… except… some boats are very close to each other, and despite the lake expanding in surface area, their own velocities and close proximity to each other makes this lake expansion barely noticeable, and they can approach each other just fine.
But, in the bigger picture, the effect is accumulative. The further you look out across the lake, the boats that are farther out seem to be receding from you faster than those close by. And this is symmetrical. The furthest boat that you can see on the horizon appears to be cruising away from you at crazy speeds. But really, he’s barely moving under his own power; in fact, both you and him dropped anchor, yet you see him flying away from you, and he sees you flying away from him.
Now replace the lake with spacetime. The deluge of water as the expansion of spacetime. The boats with galaxies. And boats that are close by and coming toward you as Andromeda and the Milkyway (and their own velocities as gravitational attraction, etc.).
Where is this deluge of spacetime coming from? I dunno.
Actually, it will, as long as you let the simulation run for a bit first. You start off with a random distribution of velocities, with some larger than others. After some time, the ones with a larger initial velocity have moved a greater distance, while retaining their initial velocities. As long as the typical speed times the time is significantly greater than the size of the initial distribution of molecules, you’ll even get a Hubble law showing up, with the distance between molecules and their relative speed being proportional.
As others have said, this is where you are going wrong. Just to expand on what others have said, some galaxies are actually in local clusters that orbit each other, with smaller mini-galaxies orbiting and sometimes merging with larger ones. In addition, even these large galactic clusters aren’t all moving away from each other…some are moving towards others, some are moving away. Think of when you blow up something (I like to think of that bit concrete truck the Mythbuster’s destroyed in their first season). Everything is flying apart during the explosion, but some of the debris will inevitably collide, right? Same thing here, though overly simplified, since in the universe, space itself is expanding.
From what I recall it’s Andromeda, and we are talking several billion years, but yeah…it’s a possibility.