  Using spectral methods, we analyse the orbital structure of prolate/triaxial
dark matter (DM) halos in N-body simulations to understand the processes that
drive the evolution of shapes of DM halos and elliptical galaxies in which
central masses are grown. A longstanding issue is whether the change in the
shapes of DM halos is the result of chaotic scattering of box orbits, or
whether they change shape adiabatically in response to the evolving galactic
potential. We use orbital frequencies to classify orbits, to quantify orbital
shapes, and to identify resonant orbits and chaotic orbits. The frequency-based
method overcomes the limitations of Lyapunov exponents which are sensitive to
numerical discreteness effects. Regardless of the distribution of the baryonic
component, the shape of a DM halo changes primarily due to changes in the
shapes of individual orbits within a given family. Orbits with small
pericentric radii are more likely to change both their orbital type and shape
than orbits with large pericentric radii. Whether the evolution is regular (and
reversible) or chaotic (and irreversible), depends primarily on the radial
distribution of the baryonic component. The growth of an extended baryonic
component of any shape results in a regular rather than chaotic change in
orbital populations. In contrast the growth of a massive and compact central
component results in chaotic scattering of a significant fraction of both box
and long-axis tube orbits. The growth of a disk causes a significant fraction
of halo particles to become trapped by major global orbital resonances. Despite
the fact that shape of a DM halo is always quite oblate following the growth of
a central baryonic component, a significant fraction of its orbit population
has characteristics of its triaxial or prolate progenitor (ABRIDGED).
