Warning: spoilers for MCU’s Capitan Marvel, MCU’s Avengers, Netflix’s Jessica Jones season two and rubikanon’s Extinction.
You set up something early in a story, and later you pay off this setup, preferably in some unexpected way. Also if there is a big interval between setup and payoff, you should remind your readers about the setup. This is a basic yet powerful tool of a writer. Some of the ways to make this tool more powerful are playing with expectations and making a double payoff.

Expectations
Everything you write creates expectations for how things will unfold later in the plot. Both the reader and the hero should have expectations. Setups naturally produce expectations about how they will pay off.
Most setups pay off in an expected way: for example, our hero can produce small magic fire from their hands, then set up that emotions affect magic, and in the next battle the hero, fearing for his friends and angry at his attackers, can throw big fireballs(payoff) at his enemies.
But for some setups, you can play with these expectations, by paying off in an unexpected way. This creates a gap between what the reader/character expected and what happened. The unexpected payoff is more satisfying because it adds something new to the story: it forces the reader to reevaluate the plot, and the character must adapt to the new reality of the situation.

Note that an unexpected payoff must be plausible.
Examples:
1. Jessica Jones
Jessica Jones had a friend Trish. In the second season, she had a new boyfriend – Griffin. When Trish went missing, he went through her research about Jessica and other superhumans. Jessica questioned him, and he said that he was just looking for Trish (something strange was a
Trish was found and they reunited with Griffin. But in the next scene when she left the room, he used a flash drive to do something to Trish’s laptop (
Later, after a sex scene, Trish told Griffin that he was different from her previous boyfriends, that he loved her and stayed with her despite her dangerous life. And right after that he received a strange call, waited for Trish to go away, and talked with someone about something that he didn’t want Trish to know (this is an interesting scene because the viewer can see the contrast between Trish’s notion that Griffin is her best boyfriend and the reality that he is doing something potentially dangerous like her previous boyfriend did).
After a few scenes, Trish’s mother came to her and told her that a company wanted to meet with Trish today to talk about career opportunity that Trish wanted. Then Griffin called Jessica, and without stating the reason told her that Trish needed to see her.
Trish and her mother came to a crowded open-air restaurant, which had a musician with a guitar. Trish even recognized her aunt and uncle. Trish didn’t understand what was going on. Jessica came, the musician played the guitar, Trish saw Griffin and he asked her to marry him (positive payoff: the viewer was tricked, this payoff was unexpected but perfectly plausible, the viewer can remember how Griffin helped setup Trish and her mother’s branch).
2. Avengers
When Loki came from the portal he had a scepter. Using it he brought Hawkeye and Erik Selvig under his control (setup: Loki’s
Before the final battle, Loki and Tony Stark argued about how the battle would end, but when Loki decided to use the
One setup ≠ One payoff
In writing, everything must do more than one thing, to create maximum meaning with a minimal amount of words. Dialogue, for example, propels a plot forward, characterizes characters, shows their motivation, adds conflict and raises the stakes. Internal dialogue shows character motivation, describes events, characters and setting through a character’s POV.
So a setup too can produce more meaning if it results in more than one payoff. One setup can have two payoffs. And it’s more interesting if payoffs have different implications. Because if one setup pays off twice as positive or negative, the second payoff adds no new meaning to the plot.
But if the second payoff differs from the first then the reader will look back at the plot and question themselves: how they hadn’t thought about it. How this new angle on the setup changes all other
The key is to find an ambiguous setup that can be viewed as a good thing in one circumstance and as a bad thing in another.

Examples:
1. Extinction
I must mention that the first time I noticed this method was in one of the best Harry Potter fan fiction stories – Extinction by rubikanon (Thank you!) – I highly recommend this story.
Narcissa and Hermione were with friends investigating strange events in a remote region of England.
After they found a lead they were confronted and have to fight back. In the process, Hermione lost her wand. On the next
Then, after a few scenes aurors searched the manor, they discovered many wands, and they thought that Narcissa created these wands for Death Eaters(negative payoff, this new angle on the setup compels the reader to question themselves, to reevaluate the plot and their view on Narcissa’s character. Was she working with the Death Eaters the whole time while deceiving Hermione? Wandmaking is a great ability because it’s ambiguous: it can be used to help a friend, or to create weapons for forces of evil.).
2. Capitan Marvel
Not all parts of the movie were great(partly because of leaked spoilers). But the scenes with the cat, Goose, were fun.
Carol and Fury met Goose on an Airforce base, and Fury took a liking to the cat. When Talos first met the cat he feared it and he said that it wasn’t a cat, but was a dangerous alien – Flerken, but nobody believed him. After all, Goose looked like a cat, so she must be a cat (setup).
But when the Kree captured Goose and scanned her, they confirm Talos’ words that Goose was a highly dangerous Flerken (payoff).
A battle with the Kree started, the Kree chased down Fury, and Goose summoned tentacles with fangs to kill the Kree soldiers and saved Fury (p
After the battle with Kree was won, Fury cuddled with Goose, but Goose attacked Fury, blinding Fury’s left eye (negative payoff, Fury has an ambiguous relationship with Goose. She helped Fury for some reason (maybe she liked how Fury scratched her), but for some other reason (maybe because she is still a dangerous Flerken) she injured Fury. Goose is an ambiguous character, she has the traits from both a cat and a Flerken. Also, this is the payoff for the Winter Soldier scene, when Fury mentioned that the last time he trusted someone he lost an eye).
Conclusion
Setup and payoff is a great tool. Playing with expectations and the double payoff can make it more satisfying for a reader, just remember to keep it plausible.