While it is true that the universe is expanding on a large scale, and galaxies are moving away from each other, it's important to note that the expansion of the universe doesn't directly affect the positions of individual stars within a galaxy.
Stars are gravitationally bound within their respective galaxies, which means that the gravitational forces between stars and other celestial objects hold them together. These gravitational forces are much stronger than the expansion of the universe on smaller scales, such as within a galaxy.
Therefore, within a galaxy, the gravitational interactions dominate, and the stars remain relatively fixed in their positions relative to each other over relatively short timescales. However, it's worth mentioning that over extremely long timescales, galaxies themselves can change their shapes and positions due to interactions with other galaxies or the overall dynamics of the expanding universe.
In summary, while the universe as a whole is expanding, the gravitational forces within galaxies are stronger than the expansion, resulting in stars appearing to remain in the same place relative to each other within their respective galaxies.