This high-level overview of the proposed Mars sample return mission shows how a spacecraft would land on Mars and deploy a rover to retrieve cached samples. Then, those samples would be launched from Mars surface into orbit, where another spacecraft would collect them and return them to Earth.
NASA