What dictates the complex orbital paths of stars within a galaxy like the Milky Way?

Answer

The combined gravitational influences of billions of stars and dark matter.

The paths of stars within a galaxy are determined by the total mass enclosed within their orbits, which is dominated by the combined gravitational effects of billions of stars and dark matter.

What dictates the complex orbital paths of stars within a galaxy like the Milky Way?
physicsSpacegravitystarmotion