Sonya Gomez is a young Ensign who has just joined the Enterprise crew, only to find it difficult to fit in with such a regimented and disciplined environment. Her commanding officer Geordi La Forge tries to advise her to calm down and relax. The advice falls on deaf ears however, when Ensign Gomez orders hot chocolate from the replicator, only to bump into Captain Picard and spill the drink all over his uniform. A clearly irritated Picard attempts to dismiss the accident, leaving engineering to change into a new uniform. Before he can arrive in his quarters, he finds himself inexplicably aboard an Enterprise shuttlecraft, with none other than Q manning the controls.
Meanwhile, Commander Riker and Lieutenant Worf realize that Captain Picard is not on board the Enterprise, and begin an intensive search of the surrounding sector. Back on the shuttlecraft, Picard becomes passive-aggressive and refuses to entertain what he believes are Q's foolish machinations. Picard eventually agrees to hear him out if he will be returned to the Enterprise. In the blink of an eye, Picard finds himself in Ten-Forward with Q, who has inadvertently attracted the attention of Guinan who has been working behind the counter. Worf and Riker are notified of Picard's return to the ship, and track him to Ten-Forward. Having sensed Q's presence, Guinan confronts Q who immediately becomes agitated at her presence, calling her a dangerous creature and threatening to wipe her out of existence. Picard brings the confrontation to a close, and demands that Q reveal his intentions. Worf and Riker arrive in time to hear Q request a station on board the Enterprise, offering his assistance to the crew and their exploration of the galaxy. Picard flatly refuses Q's help, despite the omnipotent being's warnings that the Federation will soon encounter beings far more powerful than measly opponents like the Romulans or the Ferengi. Again, Picard refuses, boldly claiming that they are ready for whatever is out there. Q becomes irritated at Picard's seeming arrogance, and with a snap of his fingers, sends the Enterprise light years across the galaxy to an unexplored region of space. Data reveals that at maximum warp, it would take 2 years to reach the nearest star base. Guinan becomes highly agitated, and advises Picard to start back immediately for home.
Picard is intrigued by this new region and space, and decides to investigate against Guinan's better judgment. They soon come across a planet that has been stripped of all its industrial and machine elements by an unknown force. Data remarks that it is similar to the mysterious destruction of the Federation and Romulan outposts lining the Neutral Zone, which was hinted at by both sides in the Season 1 episode The Neutral Zone. It isn't long before the Enterprise encounters a strange ship of oddly simplistic design; a Cube-shaped vessel with no obvious bridge, engineering section or propulsion system. Curious, Picard halts course and tries to make contact with the vessel, with no response. Picard asks Guinan for her advice. She reveals that the ship belongs to a race of cybernetic creatures called the Borg, whom her people encountered a century prior. On her advice, Picard orders the Enterprise's shields raised. Some time later, the Enterprise is boarded by a single Borg that enters the engineering section and attempts to hack into the Enterprise main computer. A security officer attempts to restrain the invader, only to be flung clear across the engineering bay. Worf draws his phaser and kills the Borg. Moments later, another Borg transports on board and resumes the computer hack. Worf fires at the new invader, but is stunned to see that the Borg has adapted to the phaser modulation, suffering absolutely no damage. With its task complete, the Borg removes several components from its dead peer and disappears back to the Cube vessel.
Picard orders a conference in the observation lounge with Guinan as a guest. She reveals that that Borg swept through her system and decimated her race, scattering the few remaining survivors across the galaxy. Q joins the conversation, taunting Picard about his newfound enemy and its wholly unique way of being. The Borg then make contact with the Enterprise, advising them that their technology is inferior to theirs, and any attempt to resist their advances will be met with punishment. A Borg tractor beam locks onto the Enterprise and holds it steady, while a finely tuned cutting beam slices cylindrically into the Enterprise saucer section, pulling out an entire section of the ship and killing 18 crew members in the process. The Enterprise begins firing wildly at the Borg Cube in an attempt to damage the ship. They are successful, leaving the Borg Cube silent. Commander Riker assembles an away team and transports over to the Borg ship to learn more about their adversary. Riker, Data and Worf transport over and learn that the Borg are stationed in thousands of alcoves which allow them to link together in a single hive-mind to facilitate ship functions, with no single Borg having a sense of individuality. Riker comes across a Borg maturation chamber where newborn babies are almost immediately fitted with cybernetic implants and grown to become full Borg. Moments later, Data advises Riker that the Borg are completing repairs to their ship by regenerating the damaged hull. Picard immediately orders the away team beamed back aboard, and sets course at maximum warp away from the vessel. The Borg follow in pursuit, matching their warp speed and managing to overtake them even as the Enterprise's engines are taxed to their limit. The Enterprise launches several torpedoes at the pursuing Borg ship with no effect, the vessel is now immune to the Enterprise's weapons. The Borg fire energy-draining torpedoes at the Enterprise to knock out its shields and prepare for a new assault. Q arrives on the bridge of the Enterprise and assures Picard that there is no hope. The Borg cannot be outpaced or outmatched. They will keep pursuing until the Enterprise is exhausted and at their mercy. Picard relents, publicly proclaiming his error in judgment and declaring that he needs Q to intervene. Before the Borg can overtake the ship, Q flings the Enterprise back across the galaxy to its original position. Picard acknowledges the lesson Q tried to teach, but scathes him for the needless death of 18 crew members at the hands of the Borg. Q advises Picard that if the Federation can't take a beating, it should head back home and hide in safety. He departs the ship, not bothering to pursue placement on the Enterprise.
Picard and Guinan join each other in Ten-Forward and talk over a game of chess over what has just transpired. Guinan tells Picard that Q's actions have brought about their encounter with the Borg much sooner than it should have been, and that they are now aware of the Federation's presence and will be coming in full force. Picard dreads this revelation, knowing full well that the Borg Cube could theoretically reach Federation space within 2 years, leaving Starfleet little time to prepare.
In truth, Q brought about the encounter to prepare the Enterprise and the Federation, albeit insignificantly, for a future Borg assault.