Q both created and manipulated the Borg. They/He did this in order to prevent the version of the Federation in the Mirror Mirror universe from coming to power. Without the Borg , the events of Star Trek:First Contact would never have happened and the United Federation of Planets would become the Terran Empire. The Borg also made an alliance between long-time Federation adversaries the Romulan Star Empire. This allowed the Borg to invade Federation space by passing through Romulan space (the first time round) and is the reason for the Enterprise-E being ordered to the Romulan border in Star Trek:First Contact . Elder Romulan politicians and officers who opposed the alliance were ousted (and probably assimilated) in a coup, allowing ambitious officers like Sela to come to the fore. It makes a weird kind of sense for the Romulans to ally with the Borg, if only to keep the Federation on its toes. This means t...