The popular conception of horror is generally centered around physical harm being dealt to someone. Slashers filled with torture and murder certainly abound, but there’s also an entire subsection of the genre concerned with harm being dealt to the mind instead. When someone’s entire sanity is at stake, the intensity of the movie, book, or story is ratcheted up considerably.
Horror shows us that there are multiple reasons why someone might lose their mind. Isolation is a big contributor: films like The Shining and The Lighthouse demonstrate the terrifyingly real effects of cabin fever. Someone also might be driven to insanity through the actions of another person. They also might just be made to feel insane through manipulation and gaslighting.
Insanity can also be used as a compelling storytelling tool. If we are led to believe that the narrator or protagonist has lost their mind, it makes them unreliable. This creates narrative ambiguity, something that leads to a variety of interesting and experimental techniques.