Earlier questions (e.g. How does Dark Matter form a halo?) referred to the distribution of dark matter in the galaxy. My question is different (not a duplicate). I wonder why dark matter would form a halo around a galaxy at all.
Dark matter does not interact electromagnetically and therefore does not lose its kinetic energy, at least not nearly as much as normal matter. Therefore, a flying by particle of dark matter that is not on an orbit around a galaxy may change its direction, but will still fly away. In other words, dark matter that is not in the halo of a galaxy already will not be in this halo, unless somehow slowed down.
So, how does a halo form in the first place? Does a forming galaxy simply attract the dark matter that happens to be local there? Or is dark matter a decay product of normal matter in the galaxy?
Image credit: Wikipedia