The traveler is a TARDIS void ship, inside is Gallifrey. They crossed the void to our demension, followed by the hive and the vex (cybermen). The Doctor couldn't get to our demension to protect the traveler, so he created the ghosts out of pieces of the traveler left behind, the ghosts were sucked through the void to the object they were created from, chose guardians, and defended the traveler. Eventually the doctor got through himself, after hundreds of years of searching for a way across the void. He then chose a new companion... an Exo woman. However someone else came through the void... the commander. Now posing as the Speaker, the commander has his own plan for getting gallifrey back, and is using guardians to do it. Using the guardians for war, whereas the Doctor meant them to simply defend, the commander wants them to conquer.
Happy fun times.
-
The traveler is a giant machine that supposedly "fought" the darkness. But jk. It rammed through it and got ripped into shreds. Whatever built the traveler built the exos and vex. The vex weren't evil originally,the exos and vex along with the vault of glass,was just a fighting simulation. Exos vs vex in an ultimate war. The vex somehow took the remnants of this "darkness" and created the black garden but went back in time creating this new foundation under Mars for their new leader. The exo stranger must have survived this fighting simulation and escaped and is now trying to help us defeat the vex. Thus why the black heart was the final boss.