Q in part did all this to help tweak a temporal paradox that led to one of Picard’s allies, Dr. Agnes Jurati, joining a reformed Borg Queen in the past to create a less-aggressive collective. This culminated in Borg-Jurati coming to the aid of the Federation when a massive Transwarp Conduit (just like the subspace corridor system the Borg used to advance their cybernetic civilization) opened up in the Sol system, threatening to destroy billions of people for.. .reasons. After that got dealt with in like, five minutes, Borg-Jurati revealed that despite Transwarp being the Borg’s whole thingthey don’t actually know who tried to open this conduit, so she proposes that the Borg Collective join the Federation in a temporary membership capacity, so Starfleet and the Collective can research and investigate it together.
This is insane. It is insane. That whole season finale was insane. But don’t worry about it because from what we know, season three of Picard is set about a year after the events of season two and no one ever mentions That Time The Borg Joined The Federation. Everything seems to be fine. No one is screaming about one of the most insane things to ever happen in the world Star Trek constantly. Don’t worry about it.