I think horror often has a different role in juvenile fiction.
Horror for adults is about showing some genuinely horrible things that don't always end well. Part of the pleasure is morbid fascination. A lot of short stories within the genre, certainly, are like concise little "jokes", where the punchline is a moment of revulsion rather than amusement.
Conversely, horror for juveniles is *often* (not always) just a variation on the same old themes of conflict and resolution. The zombies and other nasties can be squelchy and gruesome, but in terms of the drama that's unfolding and the emotions they evoke, they might as well be orcs or pirates. They're just another kind of colourful villain for the hero to confont and conquer.
That's not a hard and fast rule however. For instance, James Herbert generally writes books that end happily, with the hero emerging triumphant. I tend to read his books as trashy modern day fantasies rather than actual horrors. What I mean is, a lot of his books are more about people battling extraordinary or supernatural villains and coming up trumps (like Harry Potter does) than they are about genuine, mounting horror.
Equally, I imagine there are some books for children that are truly horrible, by kids' standards at least.