  We study the stellar angular momentum of thousands of galaxies in the
Illustris cosmological simulation, which captures gravitational and gas
dynamics within galaxies, as well as feedback from stars and black holes. We
find that the angular momentum of the simulated galaxies matches observations
well, and in particular two distinct relations are found for late-type versus
early-type galaxies. The relation for late-type galaxies corresponds to the
value expected from full conservation of the specific angular momentum
generated by cosmological tidal torques. The relation for early-type galaxies
corresponds to retention of only ~30% of that, but we find that those
early-type galaxies with low angular momentum at z=0 nevertheless reside at
high redshift on the late-type relation. Some of them abruptly lose angular
momentum during major mergers. To gain further insight, we explore the scaling
relations in simulations where the galaxy formation physics is modified with
respect to the fiducial model. We find that galactic winds with high
mass-loading factors are essential for obtaining the high angular momentum
relation typical for late-type galaxies, while AGN feedback largely operates in
the opposite direction. Hence, feedback controls the stellar angular momentum
of galaxies, and appears to be instrumental for establishing the Hubble
sequence.
