The page just says that it predicts the foe's moves. How does it predict the moves?
Forewarn shows the opponent's move with the highest power. If two or more moves are of the same power, one will be chosen at random.
Forewarn (Bulbapedia)
Do note that Anticipation's flavour text is similar to Forewarn, but the two do not do the same thing.