The Star Destroyer was evidently able to track them from the system where they stole the Death Star plans, Scarrif, to Tatooine.
But the system had been swarming with Imperials. They’d caught on to Leia’s bogus tale about her ship’s breaking down, but the cover had helped her stall long enough to download the technical plans for something code-named “Death Star.” Despite the Rebels’ efforts to lose the Imperials in the jump to hyperspace, the hulking Star Destroyer had caught up to them. And Leia knew, the moment the ship identified itself as the Devastator, there would be no escape.
It was Darth Vader’s ship.
A New Hope: The Princess, the Scoundrel, and the Farm Boy
You may wish to note that tailing a ship at lightspeed should be an extremely tricky affair that relies on guessing which route the ship follows and how fast it can travel, however in the novel Tarkin, we see that Vader has shown a deep ability to use the Force to trail his prey, even through Hyperspace.