Using N–body/hydrodynamical simulations which include prescriptions for Star Formation , Feed-Back and Chemical Evolution , we explore the interaction between baryons and Dark Matter ( DM ) at galactic scale . The N–body simulations are performed using a Tree–SPH code that follows the evolution of individual DM halos inside which stars form from cooling gas , and evolve delivering in the interstellar medium ( ISM ) mass , metals , and energy . We examine the formation and evolution of a giant and a dwarf elliptical galaxy of total mass 10 ^ { 12 } M _ { \odot } and 10 ^ { 9 } M _ { \odot } , respectively . Starting from an initial density profile like the universal Navarro et al ( 1996 ) profile in the inner region , baryons sink towards the center due to cooling energy losses . At the end of the collapse , the innermost part ( \simeq 1 / 20 of the halo size ) of the galaxy is baryon-dominated , whereas the outer regions are DM dominated . The star formation proceeds at a much faster speed in the giant galaxy where a spheroid of 8 \times 10 ^ { 10 } M _ { \odot } is formed in 2 ~ { } Gyr , with respect to the dwarf galaxy where the spheroid of 2 \times 10 ^ { 7 } M _ { \odot } is formed in 4 ~ { } Gyr . For the two objects the final distributions of stars are well fitted by a Hernquist profile with effective radii of r _ { e } = 30 kpc and 2.8 kpc , respectively . The dark-to-luminous transition radius r _ { IBD } occurs roughly at 1 ~ { } r _ { e } , as in real ellipticals . The DM halo density evolution is non-adiabatic and does not lead to a core radius .