  The dense interiors of massive galaxies are among the most intriguing
environments in the Universe. In this paper we ask when these dense cores were
formed and determine how galaxies gradually assembled around them. We select
galaxies that have a stellar mass >3x10^10 Msun inside r=1 kpc out to z=2.5,
using the 3D-HST survey and data at low redshift. Remarkably, the number
density of galaxies with dense cores appears to have decreased from z=2.5 to
the present. This decrease is probably mostly due to stellar mass loss and the
resulting adiabatic expansion, with some contribution from merging. We infer
that dense cores were mostly formed at z>2.5, consistent with their largely
quiescent stellar populations. While the cores appear to form early, the
galaxies in which they reside show strong evolution: their total masses
increase by a factor of 2-3 from z=2.5 to z=0 and their effective radii
increase by a factor of 5-6. As a result, the contribution of dense cores to
the total mass of the galaxies in which they reside decreases from ~50% at
z=2.5 to ~15% at z=0. Because of their early formation, the contribution of
dense cores to the total stellar mass budget of the Universe is a strong
function of redshift. The stars in cores with M_1kpc>3x10^10 Msun make up ~0.1%
of the stellar mass density of the Universe today but 10%-20% at z~2, depending
on their IMF. The formation of these cores required the conversion of ~10^11
Msun of gas into stars within ~1 kpc, while preventing significant star
formation at larger radii.
