When the landing legs are retracted, the platform will lower down and dock with the rover (if it's there). It can now be moved around:
When the legs are deployed, the platform is stationary and the rover is lifted slightly off the ground. It can now undock: