when there is a barrier with one or many small holes that prevent the gas to
expand into the new volume unless a gas molecule happens to travel through the
hole. The term "small" when referring to the holes are holes with
diameters less than the mean free path of the gas molecules. The mean free path
is the average distance traveled by an individual gas molecule before it
collides with another gas molecule.
occurs when the holes in the barrier are larger than the mean free path of the
gas. If there is no barrier at all, you can think of a barrier with one large
hole big enough to cover the boundary between the two volumes. This would mean
the gas will diffuse into the new container.