1. Q himself answered your question in Season Two Episode 16 when he sent the Enterprise to encounter the Borg for the first time - "Q Who".
"The Borg are the ultimate user. They're unlike any threat your
Federation has ever faced. They're not interested in political
conquest, wealth, or power as you know it. They're simply interested
in your ship, its technology. They've identified it as something they
can consume."
— Q, commenting during a senior staff briefing
The Borg do not see the Federation as a threat, nor are they impressed with them as a society. They simply want their technology and have no issue whatsoever in sending a cube thousands of light years to get it, especially since they know that the Federation posed little threat to them.
2. Several years later during the timeframe "Star Trek - First Contact", the Borg have learned that the Federation isn't quite as weak as they first thought, and they have something more to offer then just technology. This is why they went back in time to try and assimilate Earth and humanity in the past.
BORG QUEEN (OC): What's wrong Locutus? Isn't this familiar?
BORG QUEEN: Organic minds are such fragile things. How could you forget me so quickly? We were very close, you and I. You can still hear our song.
PICARD: Yes, ...I remember you. You were there all the time. But that ship and all the Borg on it were destroyed.
BORG QUEEN: You think in such three-dimensional terms. How small you've become. Data understands me. Don't you, Data?
(Data is standing in a Borg cubicle)
PICARD: What have you done to him?
BORG QUEEN: Given him what he always wanted, flesh and blood.
PICARD: Let him go. He's not the one you want.
BORG QUEEN: Are you offering yourself to us?
PICARD: Offering myself? ...That's it. I remember now. It wasn't enough that you assimilate me. I had to give myself freely to the Borg, ...to you.
BORG QUEEN: You flatter yourself. I've overseen the assimilation of countless millions. You were no different.
PICARD: You're lying. You wanted more than just another Borg drone. You wanted a human being with a mind of his own, who could bridge the gulf between humanity and the Borg. You wanted a counterpart, but I resisted. I fought you.
BORG QUEEN: You can't begin to imagine the life you denied yourself.
PICARD: It's not too late. Locutus could still be with you, just in the way you wanted. An equal. Let Data go and I will take my place at your side, willingly without any resistance.
BORG QUEEN: Such a noble creature. A quality we sometimes lack. We will add your distinctiveness to our own. Welcome home, ...Locutus. ...Data, you are free to go.
References:
"Q Who" synopsis from Memory Alpha
"Star Trek - First contact" movie transcript from chakoteya.net