Wheel end motion is accommodated by plunge within the inner cv joints. The halfshaft can slide laterally inside this joint housing. It can also articulate in angle.
This is needed for steering because the outer cv joint center isn't completely coincident with the steer axis. It is also needed for suspension travel because the arc of the wheel end motion isn't centered on the inner cv joint center. It is also needed to accommodate movement of the powertrain on its mounts.