I know dark matter pops up on here quite often so my apologies if this has already been asked (I searched but couldn’t find much).
Anyways I’ve always kind of been a bit confused on the dark matter halo idea in regards to galaxies. If we look at a spiral galaxy rotation curve, the explanation for the higher orbital velocities on outer region stars is that there must be dark matter to account for the additional gravitational force. When I first learned this I assumed the dark matter was mixed in with regular matter inside the stars’ orbits to allow for that additional gravitational pull inward toward the center of the galaxy. However I hear it talked about often that the dark matter exists in a halo on the farther outskirts of the galaxy, which kind of confuses me.
If the dark matter has a mass and thus a gravitational attraction, wouldn’t having it on the outside of the galaxy cause the outer region stars to pull away from the galaxy’s center, not toward it? Does anyone have a good resource as to why we think dark matter lives outside the galaxies in a halo?
Thanks!

To make the star’s orbital velocity as big as is it measured to be, you need more centripetal force than can be supplied by the visible matter + supermassive black hole in the center. The extra dark matter above and below the galactic disc supplies this extra gravitational force.