Q hurled the Enterprise across the universe to combat what he perceived to be the sheer arrogance of Picard and Riker at rejecting his offer to join the crew. From the transcript
Q: Oh. Well, you may not trust me, but you do need me. You're not prepared for what awaits you.
PICARD: How can we be prepared for that which we do not know? But I do know that we are ready to encounter it.
Q: Really?
PICARD: yes. Absolutely. That's why we're out here.
Q: Oh, the arrogance. They don't have a clue as to what's out here.
GUINAN: But they will learn, adapt. That is their greatest advantage.
Q: They're moving faster than expected, further than they should.
PICARD: By whose calculations?
Q: You judge yourselves against the pitiful adversaries you have encountered so far. The Romulans, the Klingons. They are nothing compared to what's waiting. Picard, you are about to move into areas of the galaxy containing wonders more incredible than you can possibly imagine, and terrors to freeze your soul. I offer myself as guide only to be rejected out of hand.
RIKER: We'll just have to do the best we can without you.
Q: What justifies that smugness?
PICARD: Not smugness, not arrogance. But we are resolute, we are determined, and your help is not required.
Q: We'll just have to see how ready you are.
GUINAN: Q!
(The Enterprise is thrown through space at even more incredible speed than usual)
At the end of the episode, both Guinan and Picard realize Q did them a backhanded favor, noting that sending them to the Borg before they reached the Federation might have been the plan all along
GUINAN: Q set a series of events into motion, bringing contact with the Borg much sooner than it should have come. Now, perhaps when you're ready, it might be possible to establish a relationship with them. But for now, for right now, you're just raw material to them. Since they are aware of your existence
PICARD: They will be coming.
GUINAN: You can bet on it.
PICARD: Maybe Q did the right thing for the wrong reason.
GUINAN: How so?
PICARD: Well, perhaps what we most needed was a kick in our complacency, to prepare us ready for what lies ahead.
The implication there is Q initiated their confrontation specifically to teach them about the Borg. Guinan's mention of adaptation is merely part of the broader defense of Humanity. Let me paraphrase the initial exchange
Picard: We're ready for whatever is out there
Q: No you're not
Guinan: They can adapt to whatever faces them
Q: You have no idea what's out there
Riker: Well, we really don't need you either way
Picard: Yeah!
Q: Ok, let's see how you handle this! snaps fingers
Guinan isn't saying anything Picard and Riker weren't already saying