[The Princess Bride] The Man in Black knew ahead of time about the plan to kidnap the Princess Bride because...
...Prince Humperdinck initially tried to hire someone else to do the job.
Vizzini, Inigo, and Fezzik kidnap the princess when they are all alone in the woods, immediately take her to a ship, and set sail at night to the Cliffs of Insanity, which they will scale in order to take her to the Guilder frontier, where they will >!murder her and leave her body there in order to provoke a war between Guilder and Florin.!< It's a prestigious line of work, with a long and glorious tradition.
Inigo then notices they are being pursued by a small ship. It is absolutely, totally, and in all other ways inconceivable that they could be followed, as this would require the pursuer a) know the princess was to be kidnapped, b) have the means at hand to immediately switch from land travel to sea travel and c) since it would be impossible to follow another ship at night by sight, to know their ultimate destination.
As Vizzini explains: "No one in Guilder knows what we've done, and no one in Florin could have gotten here so fast."
The only way someone else could have known all these details ahead of time was if Prince Humperdinck, or more likely Count Rugen or one of his agents, had outlined the plan to other scoundrels, and the Dread Pirate Roberts caught wind of it. Knowing the plan, he knew that Buttercup was to be kidnapped and taken to the Guilder frontier.
Knowing the seas, he knew that the most direct route would be from Florin to Guilder via the Sea of Eels, and then up the Cliffs of Insanity. Although it seems to Inigo that the ship is following them, it's more that Man in Black is going to the same place, because once the kidnap plot was put into motion, he knew where he had to be in order to thwart it.