Is this an unnecessary "that"?? I'm confused whether or not to add a "that" in specific sentences [duplicate]

It's not necessary, but it's helpful. I suspect that it's more common in long sentences with complex embedded clauses, because it makes it easier to tell how the clauses relate to each other. On the other hand, short sentences are relatively easy to parse, and redundancy adds significantly to the length.

This explains why it's used in your first example, but would usually be omitted in the second.