Four competing expeditions - Federation, Klingon, Cardassian, and Romulan - attempt to solve a genetic puzzle that proves to be the key to why Star Trek's version of the galaxy contains so many humanoid life forms.
Picard has always been a student of archeology, and in this episode he is contacted by his former mentor Professor Richard Galen. The professor, who Picard said is "like the father who understood me", states that he has come across something in his travels which could be the most profound discovery of their time. Galen, however, will not tell him about what he has found unless Picard agrees to go with him, which means leaving the Enterprise and his career in Starfleet behind. Picard ultimately refuses, although he is torn about disappointing his former mentor. Shortly after angrily leaving the Enterprise, Galen's transport vessel is attacked and boarded. When the Enterprise arrives, Galen is beamed to sickbay and has just enough energy before he dies to apologize for his earlier rude remarks. Picard is fueled by this event and decides to assume Professor Galen's research. An investigation of Galen's ship yields no results other than a series of seemingly random number blocks. After studying the ambiguous number blocks for hours, the discovery is made that these fragments are compatible DNA strands which have been recovered from different worlds all over the galaxy. The crew eventually believe that they have discovered an embedded genetic pattern that is constant throughout many different cultures, and it is speculated that this was left by an early race that pre-dates all other civilizations. This would ultimately explain why so many races are humanoid. Picard resolves that the answer to the 'puzzle' will be revealed when the remaining DNA samples are obtained, and so the Enterprise travels to a remote, uninhabited planet that Galen had mentioned was his next destination. They encounter Klingon and Cardassian ships that appear to be on the same trail as themselves. These two groups believe, respectively, that the puzzle will yield the design of a formidable weapon and the secret of an unlimited power source.
The Enterprise hosts representatives from the Cardassians and the Klingons, and they all agree to combine the DNA samples that they have found so far, since all three parties have pieces of the puzzle that the others cannot find. Using the shared information, they determine a pattern in how several planets were aligned millions of years ago and extrapolate the position of a final planet. The Cardassians warp off ahead of the others, firing at both ships to disable them. However, Picard had already learned of the Cardassians' attempt to sabotage the Enterprise's defenses; the ship is fully functional, and he takes the Klingon captain to the last planet.
Upon arrival, they discover that almost all life is extinct, but scans by the Enterprise detect a small fragment of algae located on a fossilized sea-bed, and they beam down to investigate with their tricorders containing all previously known information. The Cardassians arrive, as well as an undetected Romulan force, creating a standoff. Reasoning that the sea-bed may not be completely fossilized (and thus still containing some DNA), Picard and Dr. Crusher scan the sea-bed with their tricorder while the other parties argue. They locate the final DNA fragment, which completes and runs the program. The program reconfigures the tricorder's emitter to project a holographic message. The recorded image of an alien humanoid is projected to the assembled company, and it explains that its race is responsible for the presence of life in the Alpha Quadrant. When the alien race first explored the Alpha Quadrant there had been no life other than themselves, and so they had populated various planets to create a legacy and to try to maintain their way of life after they had gone. The alien ends its message by saying that it hopes that the knowledge of a common origin will help produce peace.
The Cardassians are outraged at this (considering themselves a superior race), as are the Klingons (who hate the Romulans and are disgusted to be related to those "without honor"). Only the Federation representatives seem optimistic. The episode ends with all parties diverging, but one of the Romulan party contacts Picard and hints that "One day..." [there may be peace].