The outer halos of galaxies are known to store vital information about the formation history and merger-induced evolution of their central galaxies, since the relaxation timescales are much larger than in the innermost parts and thus the memory of the events is conserved over a long period. This information provides fundamental insights into the processes of mass growth and morphological changes, broadening our understanding of the different mechanisms of structure formation. Additionally, the radius regime where the stellar component starts to dominate over the dark matter component is the perfect place to study the interplay between dark matter and stars. This interaction between the collisionless components of a galaxy, although much slower than the gas-induced processes, significantly alters the appearance of a galaxy in the long term. A better understanding of those processes can help to shed light on the dark sides of the galaxies.\n\nIn this work, we use the combined strength of idealized high-resolution simulations of individual galaxies and large cosmological simulations to unveil some of the information encoded in the outer halos of galaxies. The high resolution simulations allow us to disentangle the impact of selected physics on the formation and evolution of galaxies in particular, while the large cosmological simulations provide a statistically meaningful sample of galaxies covering a large range in masses and environments. The first part of this thesis focuses on the interplay between dark matter and stars, revealing that both parts actually do interact through their common potential by re-ordering into a stable state where the total halo is isothermal and its density distribution follows a $\\rho \\propto r^{-2}$ profile. The gas, which dissipates energy and sinks towards the center on much shorter timescales, disturbs this process, forcing the total halo into a more compact state with approximately $\\rho \\propto r^{-3}$. Therefore, as long as gas is present, the collisionless attractor state can not be reached, but every dry merger evolves the system towards it. This is also apparent by the fact that more evolved halos have higher central dark matter fractions and smaller amounts of stars formed in situ, and that the slopes are generally steeper at high redshifts. We conclude that the equilibrium attractor state of dry merging systems provides a new test case for $\\Lambda$CDM and prove that, if $\\Lambda$CDM is correct, the dark matter and the stars do communicate through their common gravitational potential.\n\nThe second part of this thesis deals with the information provided by the stellar halo. We show that the radial density profiles of all stellar halos have a universal shape which can be described by a curved exponential, independent of the morphology of their central galaxy. The strength of the curvature appears to be an indication for the amount of merging a galaxy suffered, since the stellar halo mostly grows through merging as the cold gas density in the halo region is much too low to cause a significant amount of star formation at all redshifts. With such a universal shape at hand, it is possible to study the deviations from this shape to learn about the details of the stellar accretion history of a galaxy, since different types of events leave distinct signatures. We suggest that more emphasis on the understanding of those different signatures is needed in the future to fully exploit the rich information contained in the outer halos, to learn more about the accretion driven but also the secular evolution of galaxies.