Stars are gravitationally fastened to their galaxies and move in concert with their surroundings. But sometimes, something breaks the bond. If a star gets too close to a supermassive black hole, for example, the black hole can expel it out into space as a rogue star.
Source:
phys.org