Recently I did something that many people would consider unthinkable, or at least perverse. Before going to see “Avengers: Infinity War,” I deliberately read a review that revealed all of the major plot points, from start to finish.

Don’t worry; I’m not going to share any of those spoilers here. Though I do think the aversion to spoilers – what The New York Times’ A.O. Scott recently lamented as “a phobic, hypersensitive taboo against public discussion of anything that happens onscreen” – is a bit overblown.

As a cognitive scientist who studies the relationship between cognition and narratives, I know that movies – like all stories – exploit our natural tendency to anticipate what’s coming next.

These cognitive tendencies help explain why plot twists can be so satisfying. But somewhat counterintuitively, they also explain why knowing about a plot twist ahead of time – the dreaded “spoiler” – doesn’t really spoil the experience at all.

The curse of knowledge

When you pick up a book for the first time, you usually want to have some sense of what you’re signing up for – cozy mysteries, for instance, aren’t supposed to feature graphic violence and sex. But you’re probably also hoping that what you read won’t be entirely predictable.

To some extent, the fear of spoilers is well-grounded. You only have one opportunity to learn something for the first time. Once you’ve learned it, that knowledge affects what you notice, what you anticipate – and even the limits of your imagination.

What we know trips us up in lots of ways, a general tendency known as the “curse of knowledge.”

For example, when we know the answer to a puzzle, that knowledge makes it harder for us to estimate how difficult that puzzle will be for someone else to solve: We’ll assume it’s easier than it really is.

When we know the resolution of an event – whether it’s a basketball game or an election – we tend to overestimate how likely that outcome was.

Information we encounter early on influences our estimation of what is possible later. It doesn’t matter whether we’re reading a story or negotiating a salary: Any initial starting point for our reasoning – however arbitrary or apparently irrelevant – “anchors” our analysis. In one study, legal experts given a hypothetical criminal case argued for longer sentences when presented with larger numbers on randomly rolled dice.

Plot twists pull everything together

Either consciously or intuitively, good writers know all of this.

An effective narrative works its magic, in part, by taking advantage of these, and other, predictable habits of thought. Red herrings, for example, are a type of anchor that set false expectations – and can make twists seem more surprising.

A major part of the pleasure of plot twists, too, comes not from the shock of surprise, but from looking back at the early bits of the narrative in light of the twist. The most satisfying surprises get their power from giving us a fresh, better way of making sense of the material that came before. This is another opportunity for stories to turn the curse of knowledge to their advantage.

Remember that once we know the answer to a puzzle, its clues can seem more transparent than they really were. When we revisit early parts of the story in light of that knowledge, well-constructed clues take on new, satisfying significance.

Consider “The Sixth Sense.” After unleashing its big plot twist – that Bruce Willis’ character has, all along, been one of the “dead people” that only the child protagonist can see – it presents a flash reprisal of scenes that make new sense in light of the surprise. We now see, for instance, that his wife (in fact, his widow) did not snatch up the check at a restaurant before he could take it out of pique. Instead it was because, as far as she knew, she was dining alone.

Even years after the film’s release, viewers take pleasure in this twist, savoring the degree to which it should be “obvious if you pay attention” to earlier parts the film.

The pluses and minuses of the spoiler

At the same time, studies show that even when people are certain of an outcome, they reliably experience suspense, surprise and emotion. Action sequences are still heart-pounding; jokes are still funny; and poignant moments can still make us cry.

As UC San Diego researchers Jonathan Levitt and Nicholas Christenfeld have recently demonstrated, spoilers don’t spoil. In many cases, spoilers actively enhance enjoyment.

In fact, when a major turn in a narrative is truly unanticipated, it can have a catastrophic effect on enjoyment – as many outraged “Infinity War” viewers can testify.

If you know the twist beforehand, the curse of knowledge has more time to work its magic. Early elements of the story will seem to presage the ending more clearly when you know what that ending is. This can make the work as a whole feel more coherent, unified and satisfying.

Of course, anticipation is a delicious pleasure in its own right. Learning plot twists ahead of time can reduce that excitement, even if the foreknowledge doesn’t ruin your enjoyment of the story itself.

Marketing experts know that what spoilers do spoil is the urgency of consumers’ desire to watch or read a story. People can even find themselves so sapped of interest and anticipation that they stay home, robbing themselves of the pleasure they would have had if they’d simply never learned of the outcome.