"Foreshadowing" is when an author writes something that is a hint at what might come later.
For example: In The Tiger Rising, Rob's dream of the tiger being free with Sistine riding on its back is foreshadows how Sistine eventually convinces Rob to free the tiger.