There are plenty of theories as to why someone may enjoy the horror genre, be that in book, movies, or some other media.
There’s the safe-danger theory, which to me sounds like it really comes down to adrenaline thrill. This is much like why you might enjoy roller coasters. It feels dangerous but you are aware that you are safe for the entire experience. To me there is an element of truth to this idea.
There is the related but slightly different cathartic theory. This one posits that people enjoy horror as a way of facing fears in a safe environment and vanquishing them. You might then of it as an immunization theory, we face what scares us in safety the way we face weakened or killed diseases when we get out immunizations. Again, this is not without merit.
While I was watching horror films all weekend long at the Horrible Imaginings Film Festival I thought about the nature of horror cinema and how often those of us who enjoy started it quite young. This prompted an idea that perhaps one of the key elements of horror and why we enjoy it is control.
Children have no control over their lives and even as we progress through adolescence and on into adulthood we never experience full authority over the events to determine our fate. The lack of control is perhaps an essential element of horror. When you are trapped in a haunted house, the bridge is washed out, or there is nothing but the terrible vacuum of space outside you are trapped and isolated but you are also denied the control over your actions that might allow you to flee, Hunted, haunted, or stalked all have strong elements where the control, the power, and the authority over events passes from the character to the antagonists. If the story ends happily the protagonist gains control over their life, if the story has a darker ended then as the audience/reader we are comforted that in our own lives we retain more control that those poor bastards.