@Dave78
The Borg cube that Q sent the Enterprise to was a scout ship on its way to the Federation. The Borg found out about the Federation about 20 years before, when 7 of 9's parents' shuttle was captured by the cube they were studying. Q did the Federation a favor by sending the Enterprise there, I promise you.