Foreshadowing hints at future events, while a flashback reveals past events to provide context or background.