Originally the Ferengi were meant to be the powerful, cannabilistic enemy race of TNG. They made overtures of attacks on the Romulans to set up a further storyline, but mainly using it as a way to bring the Rommies back.
When the Borg were thought up, and the ferengi demoted to comic relief, it was altered so that they attacked the outposts mostly taken as truth. Even so, it's still not outright stated to have definitely been them in Q Who.
Q's spiteful act changed history, bringing a race he says himself don't belong there until about 2470, into the path of a Borg ship in the Beta Quadrant well away from known space.