Click to see Spoiler:
Basically John went back to the very beginning. That place he was at the end? HAD to be the future timeline, from before Terminator 1. John goes back, meets his own father, uncle, and lookalike for his own eventual robot girlfriend/fake sister. He's got to take over the resistance (its part of Terminator "canon" that he's not in the resistance from the beginning but comes along out of nowhere and takes it over later), then gradually send all of these loved ones (who don't KNOW they are loved ones) to their eventual deaths--just so he can be born.

Which he'd totally not do, except now he HAS to. Because if he doesn't, things won't get to the point where this John Henry computer/robot is built, and apparently that's necessary for all of this to end. Because the show has ALL been about how you can't escape fate.