The Maxwell stress
s = B^2 / (2*mu_0)
is a pressure like any other, therefore, what causes things to move is a difference. In the middle of a solenoid, the force is zero, just as the force inside a gas cylinder is zero. An opening at the end, where there is a gradient or difference, is what pushes things around.
Tim