Determination of High-Accuracy Distances of Terrestrial Planets from the Sun
The DE430 JPL ephemeris "memo" (https://ipnpr.jpl.nasa.gov/progress_report/42-196/196C.pdf) has details of how it is constructed and what from. Mercury and Venus's positions are tracked by tracking the spacecraft orbiting them (to sub-km accuracy). Mars, Jupiter and Saturn are also measured from the orbiting spacecraft such as Galileo and Cassini. The outer planets plus Pluto positions are primarily done from astrometry so measuring the positions of the planets relative to the background stars, in the past through photographic plates or with CCDs in more modern times. 

Positions of stars and planets are all measured in something called the International Celestial Reference System (ICRS) which is based on measuring very distant and fixed on the sky objects called quasars using a precise radio technique called VLBI.