Foreshadowing is a writing technique. The author will provide clues throughout the story so that a reader may be able to predict something that happens. This can be obvious or subtle. Sometimes, they are not evident until the 2nd time you read something. Since you already know the outcome, it can be easier to see obscur hints in the story and then you have an "ah ha" moment.
Foreshadowing is a literary technique where an author hints at future events in a story. It can create tension, build suspense, and provide insights into what may happen later in the plot. By using foreshadowing, authors can give readers clues about the direction of the narrative.