A few months ago I was in a discussion with one of my beta readers and we got into a discussion about foreshadowing. I tried to explain a number of different ways, only to learn that she was apparently confusing foreshadowing with flashback.
The two are entirely different. Flashback is when a character thinks about something that happened in the past, some event or series of events that aren't (usually) in the main story-line but still need to be told. Foreshadowing is a device used to make the reader think that the implausible is likely and the impossible perfectly normal.
In fiction we create worlds that are often completely different than the world we live in. Whether you're writing urban fantasy or historical fiction, you're writing about things that you've never experienced. Likely it's just as strange to your readers. Even if you're writing a biography, some things are going to need additional explanation and support in order to help your readers step into the world you're creating for them.
In order to keep the reader engaged, an author needs to convince them that these things are normal. The reader needs to be able to suspend disbelief; to set aside what they know of the world and accept what they're being told.
One way to create this level of trust is foreshadowing.
In the post a few weeks ago I talked about deus ex machine, and I used the following example.
A character ends up surrounded in an alley. The reader knows the character has no fighting ability and no weapons, but he cuts them all down with a laser that shoots from his eye.
That post focused on the implausibility of it, but for the sake of argument let's say that this is part of your story. The character is an extra-terrestrial raised as a human and is just learning about his alien skills. Readers need to know this is possible in this world, or they might just put the book down and walk away. In order to prevent that, an author needs to set the stage, so to speak.
There are literally hundreds of different ways that this could be done. The character could be a comic-geek who wonders earlier in the book if people who shoot lasers from their eyes might exist. There may be a news article earlier in the book that talks about the aliens who just landed in Tonga and wonders what they might be there for. Other skills may have come up earlier so the possibility is brought to the reader's attention that the character might be capable of more. If you have this kind of event, read through your book with an eye toward situations that might fit the bill.
Often it doesn't take much. A word here or there. A few hints before the actual event may be enough to introduce the possibility to the readers.
Think about the last book you really enjoyed. Chances are good that some event in that book took you by surprise. Likely, certain pieces had been set up well in advance so that when you got to the event itself you didn't throw up your hands in disgust and say "That would never happen." You accepted it. You took it in stride, at least in part because the author had skillfully foreshadowed the event.
But it's not just major events. If there is any aspect of the book that might make your reader pause and question, it's probably a good idea to foreshadow it in some way.
Foreshadowing will save you.