Foreshadowing in a technique commonly used in literature, both in poetry and fiction, to give hints of how a literary work will turn out, often giving the work a sense of inevitability. Anything can be foreshadowed, whether strange and ominous or mundane.
One place foreshadowing is quite common is in horror fiction or film, where it is used to build up suspense. One often finds minor examples of scary thing showing up before the final moment of peak terror.
In heroic or epic writing, foreshadowing often builds up to the grand finale of the work. For example, in Homer's Iliad, we encounter many smaller battles, in which heroes conquer less important fighters, until eventually climactic battles occur.
In ancient works, in particular, prophets and prophecies are often used to foreshadow an eventual climax, often giving it a sense of inevitability.
In romances, we often see minor encounters between the romantic protagonists, in which they nearly end up getting together, that foreshadow the eventual success of the romance.