  We study the relation between age and magnetic activity in late-type pre-main
sequence (PMS) stars, for the first time using mass-stratified subsamples. The
effort is based on the Chandra Orion Ultradeep Project (COUP) which provides
very sensitive and homogenous X-ray data on a uniquely large sample of 481
optically well-characterized low-extinction low-mass members of the Orion
Nebula Cluster, for which individual stellar masses and ages could be
determined. More than 98 percent of the stars in this sample are detected as
X-ray sources. Within the PMS phase for stellar ages in the range $\sim 0.1-10$
Myr, we establish a mild decay in activity with stellar age $\tau$ roughly as
$L_{\rm X} \propto \tau^{-1/3}$. On longer timescales, when the Orion stars are
compared to main sequence stars, the X-ray luminosity decay law for stars in
the $0.5 < M < 1.2$ M$_\odot$ mass range is more rapid with $L_{\rm X} \propto
\tau^{-0.75}$ over the wide range of ages $5 < \log \tau < 9.5$ yr. The
magnetic activity history for M stars with masses $0.1 < M < 0.4 M_\odot$ is
distinctly different. Only a mild decrease in X-ray luminosity, and even a mild
increase in $L_{\rm X}/L_{\rm bol}$ and $F_{\rm X}$, is seen over the 1-100 Myr
range, though the X-ray emission does decay over long timescales on the main
sequence. Together with COUP results on the absence of a rotation-activity
relation in Orion stars, we find that the activity-age decay is strong across
the entire history of solar-type stars but is not attributable to rotational
deceleration during the early epochs. A combination of tachocline and
distributed convective dynamos may be operative in young solar-type stars. The
results for the lowest mass stars are most easily understood by the dominance
of convective dynamos during both the PMS and main sequence phases.
