When we write fiction, we can work the story any way we want to. We can kill off three characters or we can make the hero the beneficiary of a huge inheritance. We can even leave the hero licking his wounds after being soundly defeated by the villain, although this isn't likely. Even as writers, we want our hero to be successful in his journey with problem solving. We want a happy ending. In a novel, the hero meets obstacles along the way that would knock an average guy down and keep him down, but our hero picks himself up and moves on. It's no wonder we'd like a happy ending for him.
Fiction writers can make sure the ending is a happy one, but in those real life stories, it's a different scenario. The writer has to tell the story as it happened. A battered woman leaves her husband, fleeing into the dark night. She wanders aimlessly, perhaps finding herself in a dangerous part of town, or she searches for an emergency shelter for women. Can this story have a happy ending? It could go either way. She might be so emotionally scarred that she'll never be normal again, or she might find hope after pulling herself together at the shelter. The writer has to tell the story whichever way it happens.
If a writer of a real life story knows the ending is going to be a sad one, she can do one thing that might ease the pain of the unhappy ending. She can tell the story as it happened, but she doesn't come to a screeching halt. She can add a paragraph or even one line that leaves the reader with a ray of hope. Even if things didn't turn out so well for the person in the story, that bit of hope at the end can leave the reader feeling some satisfaction.
It's up to the writer to determine exactly how the ending will be constructed and what the reader takes away. Hope is always better than despair.