Flashback and foreshadowing are two literary techniques used in novels in order to develop the plot in a more creative way. They can also help the writer from having to write a lengthy back story, if only a small bit of information is required. Put simply, a flashback describes something that happened before the story began, while foreshadowing gives clues to something important that will happen later in the story. Sometimes, a flashback acts as a type of foreshadowing, if it also gives clues to something that will happen later, but this is not always the case. Flashback and foreshadowing both interrupt the current plotline of a story, and can be confusing to a reader if not handled properly, so most writers use them judiciously.
In some cases, a flashback and foreshadowing are used simultaneously to give the reader an idea of what might happen later in the story. Typically, this is a pretty vague idea; this is because it is important to interest the reader and make him or her keep reading, but not to give away the ending, which can have the opposite effect. To give a basic example, a writer might describe a character who was killed by a gun in the past to indicate that another character might be killed in a similar way in the future.
It is important to remember that flashback and foreshadowing are not always used together, though. Sometimes, a flashback is just used to increase understanding of a current event or character. Often, a flashback is a great way to give a good reason for a certain character's motivations. For instance, if the reader learns that something happened to a character when he or she was younger, it might help to explain why he or she just behaved in a certain way in the story. This can be an important aspect of character development.
Conversely, foreshadowing is used to help the reader predict what might happen, or to encourage the reader to make a guess. It often happens fairly early in a story, and is frequently used at the end of a chapter, or even at the end of one book in a series. Foreshadowing is a somewhat simpler technique than a flashback; it may occur when the author notes that a character has a bad feeling, for example. This immediately makes the reader wonder what might happen in the future that could have caused this bad feeling. Using flashback and foreshadowing in a text can be good ways to increase the reader's overall engagement in the story.