gravity but to be fair the star are actually moving, sometimes as fast as 500 Km per second. moons orbit planets, planets orbits stars, stars orbit the center mass of their galaxy, and galaxies orbit each other.
the stars you see are, for the most part, all in orbit around the center of the Milky Way Galaxy just like Earth is in orbit around the Sun. The stars move yes, but they all stay in the same place relative to their orbit around the center of the galaxy. Without getting to technical I will stop there.