One of the things that humans have more than any other animal, we think, is the ability to imagine. That is, while our brains are continually processing an ongoing stream of information from the real world, we are able to carry out a parallel process: to generate an imagined world with its own series of events. Eventually our ability to imagine a parallel world gave rise to art, music, and literature, first oral and then written. When I am writing, I feel as if I am in a heavenly realm. Creativity and imagination feel like supernatural gifts.
But, as with so many other human capacities, imagination probably had an extremely practical and immediate function when it first evolved. The people who were most successful in the game of both biological and cultural evolution were those who were ready for whatever happened: very little caught them by surprise, and they always had a backup plan to deal with events. And the only way to accomplish these two things was through imagination.
In primitive society, and today, you could not and cannot assume that everyone who is acting nice really is nice. They might be concealing an imminent attack upon you. You may not have much of a factual basis for suspecting them of this, so you cannot actually do anything about it. But your imagination will give you an early warning of it, should it happen. Furthermore, you will already have a script worked out in your head about how to handle the attack, should it occur. And as a result, you can probably handle it more calmly, rather than being outraged by shock.
There is very little cost to using your imagination in this way. Of course you cannot imagine every possible attack, but you can imagine many. If you spend too much time imagining things that people might do to you, you will be bogged down in paranoia, sort of like a computer that is using most of its working memory for virus checks. As with anything else you do, maintaining a suspicious imagination is a matter of moderation. If it subtracts from your happiness, you are doing it too much. If you imagine the same scenario over and over (as I sometimes do, against my own better judgment), you are doing it too much.
A lot of fiction serves the function of anticipating possible difficulties before they actually happen. The “nightmare future” stories and novels, especially those that depict a future that is just a little different from the present, help us to be less surprised at the actions of powerful evil people, and maybe take preventive measures. Nightmare future novels can be very grim, but a good writer can use humor in a way to make you think without making you depressed. That is, imagining hopeless scenarios can be very unhealthy.
The main conclusion of the 9-11 Commission, which investigated the September 11, 2001 attacks, was that we had a failure of the imagination. We simply did not use our imaginations enough to conceive of someone using a hijacked jet as a weapon. This is what can happen if we do not imagine the perils of the future.