The near-Earth objects (NEOs) (3200) Phaethon and (155140) 2005 UD are thought to share a common origin, with the former exhibiting dust activity at perihelion that is thought to directly supply the Geminid meteor stream. Both of these objects currently have very small perihelion distances (0.140au and 0.163au for Phaethon and 2005 UD, respectively), which results in them having perihelion temperatures around 1000K. A comparison between NEO population models to discovery statistics suggests that low-perihelion objects are destroyed over time by a, possibly temperature-dependent, mechanism that is efficient at heliocentric distances less than 0.3au. By implication, the current activity from Phaethon is linked to the destruction mechanism of NEOs close to the Sun.We model the past thermal characteristics of Phaethon and 2005 UD using a combination of a thermophysical model (TPM) and orbital integrations of each object. Temperature characteristics such as maximum daily temperature, maximum thermal gradient, and temperature at different depths are extracted from the model, which is run for a predefined set of semi-major axis and eccentricity values. Next, dynamical integrations of orbital clones of Phaethon and 2005 UD are used to estimate the past orbital elements of each object. These dynamical results are then combined with the temperature characteristics to model the past evolution of thermal characteristics such as maximum (and minimum) surface temperature and thermal gradient. The orbital histories of Phaethon and 2005 UD are characterized by cyclic changes in e, resulting in perihelia values periodically shifting between present-day values and 0.3au. Currently, Phaethon is experiencing relatively large degrees of heating when compared to the recent 20,000yr. We find that the subsurface temperatures are too large over this timescale for water ice to be stable, unless actively supplied somehow. The near-surface thermal gradients strongly suggest that thermal fracturing may be very effective at breaking down and ejecting dust particles. Observations by the DESTINY+ flyby mission will provide important constraints on the mechanics of dust-loss from Phaethon and, potentially, reveal signs of activity from 2005 UD.In addition to simulating the recent dynamical evolution of these objects, we use orbital integrations that start from the Main Belt to assess their early dynamical evolution (origin and delivery mechanism). We find that dwarf planet (2) Pallas is unlikely to be the parent body for Phaethon and 2005 UD, and it is more likely that the source is in the inner part of the asteroid belt in the families of, e.g., (329) Svea or (142) Polana.