The strange thing is the Borg apparently assimilated the bases along the Romulan Neutral Zone (stardate 41986.0)...and then went off for a cup of coffee or something. The even weirder part is in Q'Who Picard references the earlier episode. So the Borg were already aware of the Federation's existence.
So just what was the Borg cube that had been supposedly picking up Starfleet bases along the Romulan Neutral Zone like Pokemon doing with itself?
The Borg knew about the Feeration even earlier than that, when they assimilated Magnus, Irene, and Annika Hansen in 2356. But the thing to keep in mind is that the galaxy is very, very large and there's a whole lot of stuff in it that has nothing to do with the Federation. The Borg had plenty of other matters closer to home to occupy their attention. The Federation was very, very far away from their territory, so it was low on their list of priorities. Borg space is huge, so it stands to reason that at any given moment, they're waging wars against dozens of civilizations or coalitions strong enough to offer some significant resistance to assimilation. Not to mention the resources and effort they'd have to expend on "domestic" affairs, managing the logistics of keeping such an immense territory operating, transferring resources to where they're needed, etc. Even with a single hive mind controlling it all and smoothly coordinating it without internal dissent, it would be a monumental effort just to keep such a vast entity from collapsing under its own weight. The Collective has a hell of a lot on its mind, so you can't expect it to drop everything to go after some new civilization it's discovered half a galaxy away.
Probably, after they assimilated the Hansens, the Borg decided to send one cube to survey the area around the Federation, perhaps not right away but when they could spare the time. It sampled some stuff around the Neutral Zone and went back to report, and the Borg filed the data away for future reference, but still had plenty of other more immediate matters to contend with. Once a large, powerful Federation vessel showed up closer to Borg territory and then escaped through inexplicable means, though, that probably piqued the Borg's curiosity enough to send a cube to assimilate it.