The U.S.S. Enterprise docks at Starbase 74 where the Bynars, a species interdependent on computers, are scheduled to upgrade the ship's computer system.

Instead of enhancing the starship's facilities, however, the Bynars program the ship's computer to read that the magnetic containment field is deteriorating and that the entire U.S.S. Enterprise will shortly be destroyed. Unable to locate Captain Picard and Commander Riker, Data evacuates the ship and launches the U.S.S. Enterprise back into space to avoid damaging Starbase 74.

Unbeknownst to Data, the Bynars have used a computer-generated woman to lure Riker and Picard into the holodeck, where they don't hear the alert to abandon the ship. Upon exiting the holodeck, the Captain and his First Officer realize that the ship is completely empty except for the Bynars, who have taken control of the U.S.S. Enterprise.

Determined not to leave the ship in hostile hands, Picard and Riker program the starship to self-destruct in five minutes. But when they beam onto the bridge, they find that the Bynars are dying. After turning off the self-destruct mechanism, Picard and Riker soon discover that the ship is orbiting the Bynars' home planet. They also learn that the aliens hijacked the U.S.S. Enterprise in order to use its computer as a replacement for their own, which was their only life-support device and was destroyed in an explosion.

Sympathetic to their cause, Picard and Riker use the U.S.S. Enterprise's computer to regenerate the one lost by the Bynars, thus saving the planet's inhabitants.