The purpose (and effect) of horror fiction may be to remind us of the terrors of which human beings are capable of suffering and inflicting--perhaps often to remind us that we "wind ourselves up," and with our imaginations can project horrors on the world, while also reminding us that human society conjures up its own demons. Edmund Burke's idea of the Sublime was that it beggared the imagination, rendering us speechless (suffering "aporia") before a reality we can't comprehend and which scares us silly, so perhaps all art, to the extent that it is about "awe," is also "awe-ful."
Below find PDFs covering two practitioners of the genre of horror: Poe and Lovecraft.