To steer a rover, we need a good base map. The Mariner 9 orbiter expanded maps to cover the Red Planet in the early 1970s. The imaging has only gotten better since then.
Depending on where you are, the global map has a resolution anywhere from less than a meter to more than 100 meters. For the Mars Science Laboratory (aka Curiosity), we collected high-resolution images from orbit covering the landing and main science areas on lower Aeolis Mons. NASA and Jet Propulsion Laboratory engineers used this base map and mathematical techniques to point the rover on its way to Mars and land it within a few kilometers of the target. Descent imaging pinpointed the rover within a meter or two on the surface.
Astronomy magazine subscribers can read the full answer for free. Just make sure you're registered with the website.