Navigation to high accuracy is done using radiometric tracking. There are scads of references, such as here, here (don't let the Russian language on the title slide scare you off!), and here, that explain the techniques used. They serve as general references for the discussions following.
The most straightforward part of this is measuring the distance from an Earth station to a spacecraft, and measuring the spacecraft's radial velocity with respect to that station. To do this, the Earth station (usually a NASA DSN station or an ESA station) transmits a signal to the spacecraft, and the spacecraft immediately turns it around and sends it back (at a somewhat different frequency). The carrier frequency of that signal is known to exquisite accuracy, based on an equally exquisite frequency reference like a hydrogen maser at the station. That signal is also modulated with a ranging modulation, that allows measuring to extreme accuracy the time it takes the signal to travel to the spacecraft and return.
Analysis of the ranging modulation of the returned signal allows calculating the distance from the station to the spacecraft. This reference (not for the faint of heart!) gives details about how this is done, but a chart of ranging performance vs. system parameters goes from a few meters for relatively low-performance systems (essentially, ones with low signal-to-noise ratios [SNR]), down to fractions of a meter for systems with high SNR.
Analysis of the frequency of the returned signal yields the Doppler shift in that frequency due to the radial component of the spacecraft's velocity. This allows calculating that radial velocity to extreme precision. It is done so accurately that for Cassini, the DSN had to measure the water vapor content of the air above the station to correct for refractive effects of varying water content! For Cassini, the accuracy of velocity measurements got down to ~20 microns per second. At Cassini's periapse velocities this could get down to one part in a billion of Cassini's velocity relative to Earth.
Knowing radial position with respect to Earth isn't the whole story. You need to know the spacecraft's position in the "plane of the sky" as well, and radial Doppler and ranging don't give you that. The most accurate current methods involve radio interferometry, receiving the return signal at multiple stations and using interferometric methods to pinpoint the arrival direction of the returning signal. Reference 3 quotes the accuracy as approaching one nanoradian. At a distance of one billion km, about the distance to Saturn, that yields a plane-of-the-sky accuracy of about one km.
All these methods involve considering what Earth, and specifically the receiving station, is doing while these measurements are made: Earth's orbital motion around the Sun, Earth's rotation, the station's position on Earth's surface, etc. It gets fairly complex, especially when you have to consider the effects of the air above the station. It's not just water vapor content: when the station looks straight upward (toward the zenith), it sees the minimum distance a signal must travel through that atmosphere, and the refractive effects (slowing of the signal's propagation velocity, and bending of the signal path) of that thickness. But when it looks off-zenith, the effective thickness of the atmosphere increases, as do the refractive effects. Diligent scientists and engineers have worked out all these effects to achieve the remarkable accuracies they do.
Post-processing can improve on these radiometric results. The spacecraft must obey the physics of orbital motion, so the radiometric tracking data, along with knowledge of all the significant gravitating bodies in the solar system, are fed into a huge chunk of software (JPL's is called "ODP", for "Orbit Determination Program") that fits the data with the physics and solar system geometry to reduce the net error in the spacecraft's trajectory.
Knowing how this works is like knowing the physics behind a rainbow: it in no way diminishes the beauty of seeing it in operation.