The USS Enterprise approaches the Kavis Alpha binary star system to perform astrophysics research under the guidance of Dr. Paul Stubbs, analyzing the decay of neutronium as a result of a stellar explosion that occurs every 196 years, and due to occur in the next few hours. Dr. Stubbs, played by Ken Jenkins, plans to launch a probe, dubbed the "egg", to gather the data, a result of a lifetime's worth of development. Meanwhile, Dr. Crusher has rejoined the Enterprise crew, and is warmly welcomed by her son, Wesley.
As the expected time of the stellar explosion nears, the ship begins to start malfunctioning in odd ways, and the issue is quickly traced to the computer core. Wesley, who had been working on a project involving microscopic nanites, realize that he may have inadvertently let two nanites from his experiments loose; the nanites were programmed to find ways to work together and evolve. A scan of the computer core reveals that the nanites have determined a way of replicating themselves and have taken up residence in the computer core. With the computer controls unreliable to proceed with the mission, the crew, along with Dr. Stubbs, attempt to see if they can remove the nanites from the core. However, Dr. Stubbs shoots the core with a burst of gamma radiation, destroying a large number of the nanites. They retaliate by flooding the bridge with nitrogen dioxide, which the crew is able to override. Dr. Stubbs is confined to quarters, but the nanites attempt further revenge by shocking him with electricity. Captain Picard prepares to flood the computer core with gamma radiation to remove the nanites completely, but Data is able to establish communication with the nanites, and allow them to use his body to speak with Picard. Picard realizes that the nanites are aware and took Dr. Stubbs' actions as hostile, but that they only want peace. Picard is able to negotiate a deal to send the nanites down to Kavis Alpha IV, designating it as their homeworld. The nanites agree, and repair all the damage to the computer core before they leave it. Dr. Stubbs is able to launch his probe on time, and collects numerous volumes of data to pore over. Wesley, who felt responsible for the whole incident feeling that he had been left alone for the past year without his mother, is counseled by Dr. Crusher, realizing he is now growing up.