Seven of Nine dreams of a beautiful forest. However, she finds that the forest in her dream is a real subconscious realm inhabited by the minds of certain Borg drones during regeneration periods. Few drones possess the recessive gene required to experience the realm called Unimatrix Zero.
In the surreal, utopian Unimatrix Zero, Borg of various species and ages (including children) from throughout the massive geography of the Collective exist as their individual, unassimilated selves and interact with one another as such. While out of regeneration, they revert to normal drones and have no memory of their time spent together there. The Borg Queen knows about Unimatrix Zero, considering it a disease, and destroys drones discovered capable of visiting it. However, the process of detecting affected drones is time consuming, and she is eager to find a faster method of finding and deactivating them. Those who are detected are deactivated, dismembered, and studied in an effort to speed up the search.
Seven of Nine journeys with Captain Janeway to the subconscious realm and reverts to acting more like an individual. It turns out that she used to visit Unimatrix Zero when she was still part of the collective. Her forgotten lover Axum has made contact with her so that she may help them; the inhabitants of Unimatrix Zero have developed a masking nanovirus which would inoculate them against being detected by the queen, but it can only be administered from the corporeal world. Seven soon becomes overwhelmed and discouraged by her new-found emotions and denies them at first, although she eventually comes to terms with them. If Unimatrix Zero cannot be stopped in the real world, the Queen plans to destroy it from within. Assimilated drones attack the subconscious "unassimilated" drones constantly.
As Voyager plans to help the Unimatrix-drones, the Borg Queen contacts the ship. She knows of Voyager 's recent communications with the Federation and offers Janeway transwarp technology, if Voyager is accommodating and ceases helping the Unimatrix-drones. Janeway refuses. After being blackmailed by Chakotay (he promises to have the Doctor remove her from command), Captain Janeway, Tuvok and B'Elanna penetrate the Borg cube to reach the central plexus and administer the nanovirus. Voyager distracts the Cube while they infiltrate the cube but are caught. Voyager leaves them to be assimilated.
The Janeway, Tuvok and Torres drones are un-connected to the Collective as the Doctor had inoculated them with a neural inhibitor, protecting their individuality. They proceed with their plan to help Unimatrix Zero. However, Tuvok's inhibitor wears off, and the Collective eventually overcomes his mind.
The Borg Queen confronts Janeway, demanding that the drones of Unimatrix Zero submit themselves for reassimilation. The Queen destroys several of her own ships, each housing thousands of lives, because only a handful within are "offline" and therefore suspected of being the newly sentient drones from the dream realm. Janeway calls her bluff, pointing out that such a tactic would essentially require her to destroy the entire Collective. Having discovered a means of sending Borg as drones into Unimatrix Zero, she then threatens to release a Borg-modified form of the nanovirus from within Unimatrix Zero which would kill every affected inhabitant's corporeal drone, unless Janeway agrees to speak with them.
The captain thus informs her crew that Unimatrix Zero can no longer exist. Chakotay realizes that she found a loophole the Queen never considered and that the statement is meant literally-—destroying the matrix so the Queen can't reach the affected drones as easily, as well as cutting the Queen's only way to spread the nanovirus. The drones within are informed beforehand. Seven is forced to say goodbye to her lover, who is on a Borg ship far away in the Beta quadrant. Meanwhile, Voyager, aided by a Borg sphere crewed by liberated drones, manages to rescue the away team. The episode ends as the independent Borg, who now, like the Queen, have the advantage of being self-aware, take command of any vessels they can, rebel, and start a civil war with the Collective.