This method uses the fact that if a star has a planet (or planets) around it, it is not strictly correct to say that the planet orbits the star. Instead, the planet and the star orbit their common center of mass. Because the star is so much more massive than the planets, the center of mass is within the star and the star appears to wobble slightly as the planet travels around it. Astronomers can measure this wobble by using spectroscopy. If a star is traveling towards us, its light will appear blueshifted, and if it is traveling away the light will be redshifted. Spectroscopy can show this change in color from a star as it moves towards and away from us, orbiting the center of mass of the star-planet system.
Many of the planets that have been discovered by this method are very large and very close to their stars. These planets, called super-Jupiters, are much larger than Jupiter, and orbit their stars in a matter of days. Such a large planet causes a large wobble, and this, as well as the short orbit time, makes these planets easier to detect than ones that are smaller or farther from their stars. Over 784 planets have been discovered (as of October 2018) by this method.