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.140 and 0.163 au for Phaethon and 2005 UD, respectively), which results in them having perihelion temperatures of or exceeding 1000 K. NEO population models compared to discovery statistics suggest that low-perihelion objects are destroyed over time by a temperature-dependent mechanism that becomes relevant at heliocentric distances < 0.3 au. Thus, the current activity from Phaethon is relevant to the destruction of NEOs close to the Sun, which most likely has produced meteor streams linked to asteroids in the past.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 varying depths are extracted from the model, which is run for a predefined set of a and e. 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.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. 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.3 au. Currently, Phaethon is experiencing relatively large degrees of heating when compared to the recent 20, 000 yr. 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 surface regolith. Observations by the DESTINY+ flyby mission will provide important constraints on the mechanics of dust-loss from Phaethon and, potentially, reveal signs of activity on 2005 UD.