In fiction, whether film, TV show, book, or something else, there is a spectrum of predictability. At one end, you get complete predictability. At the other end, you get complete randomness. Neither is particularly good.
Sometimes you can read a story and see exactly how it’s going to unfold. While that occasionally can work out (if you’re reading a romance, you can be reasonably confident the couple will get a happy ever after at the end) often it can be boring for readers (or viewers, etc.). If you’re reading a book that’s thoroughly predictable, there’s no incentive to turn the page.
On the other hand, a work of fiction that makes a point to be completely unpredictable is frustrating. Every plot twist comes out of nowhere. Every act that saves the day is a deus ex machina. The shocking plot twist defies reason. The reader is left thinking, “but that made absolutely no sense,” about the plot which twists and turns so much that it’s tied itself in knots.
Somewhere in the middle is the sweet spot, where understanding falls right before or right after the reveal.
For right before, this is the sort of story where you’re picking up on clues and building up on ideas and your thought process goes along the lines of, “I wonder why that thing happened? Maybe it could be because of this. Oh look, there’s another clue that fits. I think this is the reason. Yes! I was right.” You start working things out and there’s a big sense of satisfaction when you’re proved right.
Alternatively, you get the just after approach. This is what most murder mystery stories are aiming for. Once the detective reveals the murderer and explains why, all of the pieces slot into place. Everything makes perfect sense in retrospect and you suddenly see the clues you missed earlier.
As a writer, it’s extremely difficult to pull this off perfectly. You run the risk of having some plot twists too obvious and other ones that seem confusing. You also can’t be sure how well your readers (viewers, etc.) will pick up on the clues. One reader will pick up on every tiny clue and decide your book is predictable, while another will not spot a few major ones and be caught completely off-guard. It’s a delicate balance.
But my point is that it’s better to aim for that middle point. Don’t be unpredictable just for the sake of being unpredictable. But also pay attention to whether you’ve got enough mystery to keep enough of your readers guessing and wanting to turn the page and find out the answer.