It is easier to understand in 2D: Imagine a deflated balloon with two dots drawn on it. When you inflate the balloon, its 2D surface increases, which results in the two points "moving away" from each other, without either of them actually moving. It‘s just that the surface on which they lie grows. This is also the reason why distant galaxies are getting more distant faster than the speed of light: They are not actually moving, but the space in between us and them grows.
Notice that the farther two points on the surface of the balloon are apart, the faster they will appear to be moving away from each other, which is why the effect is unnoticeable over small (in astronomical terms) distances. Gravity pulls things together much faster than space expansion pulls them apart.
Bringing this back to your example: Imagine "blowing up" the box. Things inside it are growing a little bit (but gravity pulls them back together), but everything seems to be moving away from everything else.