When two objects gravitationally attract each other, they move around each other, around a fixed point, their barycenter or center of mass.
When the two masses are equal, the center of mass is in the middle of the two bodies.
When the masses are different, the barycenter is closer to the most massive body. The ratio of the distances from the center of mass is equal to the mass ratio.
A star and a planet move around their barycenter. Because the planet is much less massive than the star, the barycenter is very close to the center of the star.
In the Solar System, Jupiter is 1000 times less massive than the Sun. The distance between Jupiter and the Sun is 750 million kilometers. The center of mass is located at 750000 kilometers from the Sun, not far from the surface. The other planets, much less massive than Jupiter, alter these mouvements only slightly.
We can use this effect to search exoplanets : the presence of an invisible planet is revealed by the displacement of the star around which it orbits.