Shocks limit suspension travel in many vehicles. The limit of full shock extension is the limit of suspension travel. I found this out with our '66 wagon when the coil spring conked me in the head after I removed a shock.
As for the lateral movement, the shock is a damper, limiting oscillation. Regular shocks do the same thing, in the manner you describe.