I believe that an unhappy ending can do that. When a story has a happy ending, then you finish it and you feel satisfied and joyful about how the story ended. On the other hand, if the story ends in an unhappy manner, you start thinking about the resolutions and imagining what could lead to such an ending and how it could be fixed.