Let me explain.
Everyone loves a good surprise ending, but if the ending is too surprising, then the readers become annoyed. We want to have a satisfying ending, but readers want to feel smart in seeing some aspect of how the ending unravels.
Chekov's gun is the ultimate example of this. A gun is hanging on the wall. This may seem like a subtle detail that is part of a setting, a part of characterization, but when the dog uses it to kill her master, this becomes a satisfying part of the denouement.
Chekov wrote famously that putting these details early in a story foreshadows the later events in the story. This creates a satisfying denouement for readers.
This becomes a careful balancing act for writers. We want unexpected things to happen in our writing, but we need to lay the events carefully, so the readers can have the satisfying moment of saying, "Aha! I knew that so-and-so would happen! What a satisfying ending."