So I came across the following phrase: それが、どうしてこんなことに…… and I feel like the second part of it means something along the lines of "How did it get like this?" (I could be totally off of the mark, I'm far from sure), but what I'm most curious is what the それが means in this context. There doesn't seem to be anything before the phrase comes up in what I was reading that gives any clue to what それ could be referring to, and in fact the phrase seems to be something that stands on its own. Also, what is suggested by the に at the end? I realize it's an incomplete sentence, but does it seem like the next part of the sentence should be obvious? Thank you very much for any advice.
To "answer" without further context, something had to be going right or as planned in the story. 「それ」 refers to that whole situation where things were good.
Then, something had to happen to prevent things from going right and you are now wondering how in the world this could have happened. Correct? The phrase in question could not mean anything else.
What is left unsaid at the end would be along the lines of なったのか、なったのだろう、なってしまったのだろう、なってしまったのか, etc.
If one speaks Japanese, one will know with no effort that 「なる」 is hiding there as a key verb. Thus, one does not have to say it and chooses to end the phrase with 「に」. It just looks smarter ending the sentence that way when the readers will know what is left unsaid.