We know the Collectors come from beyond the Omega 4 Relay, a place that leads to the galactic core, all black holes and decaying suns. Anyone transporting in would immediately become sucked into the maelstrom and die. However, the Collectors use an IFF, an Identify Friend/Foe, that creates a safe space for them through the Relay. We need one to continue our mission.
And the Illusive Man knows of one. A derelict Reaper was discovered and a small Cerberus team sent to investigate. Contact with them was lost, and now we’re sent to investigate and pick up the device, a certainty on a Reaper ship. (We don’t ever learn why a Reaper floats dead. Not part of this story, I guess.)
Of course, the ship swarms with husks. On the one hand, this is a straightforward battle to the prize. On the other, though, someone mysterious saves us by sniping husks at a moment when we’re overwhelmed. The someone is a Geth wearing N7 armor.
It even calls out, “Shepard-Commander.” At the end of the quest, when we’re destroying the ship’s mass effect core to detonate it, the Geth lies unconscious/deactivated at the computer terminal. We take it with us.
Back on the Normandy, we have the decision to reactivate the Geth and learn why it knows us. (Or we could just turn it over to Cerberus for experimentation.) The Geth, whose name becomes “Legion”, explains much. The Geth that attacked us in ME1 are called “Heretics”. They are a sub-branch of Geth who chose subservience to Sovereign — the “Old Machines”. The other Geth, the Legion Geth, disdain them and fight against them. Because Shepard also fights, the enemy of my enemy is my friend. Legion joins our team.