The new Starfleet flagship Enterprise-D is assigned to travel to Deneb IV, both to collect the remaining members of its crew and to open relations with the simple Bandi people who have somehow been able to tap immense energy reserves and constructed Farpoint Station - much to the surprise of the United Federation of Planets. En route, the Enterprise is met by an omnipotent being who identifies himself a member of the Q continuum and declares that humanity is being put on trial, using their actions in this upcoming mission to judge their worthiness and to avoid extermination. Before letting the ship continue to Deneb IV, Q warns Captain Picard that he is destined to fail.
As the Enterprise arrives, the awaiting crew members explore the offerings of Farpoint Station, led by their Bandi host, Groppler Zorn. The crew is suspicious of how certain items they desire appear moments after they look away, and are unable to identify the power source that feeds the station. Deanna Troi, an empath, senses a being with powerful yet despairing emotions nearby, and others of the crew discover a strange labyrinth beneath the station, but Zorn is unable to offer an explanation. As the Enterprise crew continues its explorations, a large unknown alien craft enters orbit and begins to fire upon an older Bandi settlement near Farpoint Station, and abducts Zorn. Before Picard orders the crew to fire phasers at the craft, Q appears to remind him of humanity's trial, and prompts Picard to send an away team to the alien craft. The away team discovers the craft has passages similar to those under Farpoint, and are able to free Zorn. Their actions cause the alien craft to transform into a jellyfish-like space creature, and Picard is able to deduce the mystery of Farpoint Station. He confirms with the apologetic Zorn that the Bandi had found a similar lifeform injured on their planet and, though they attempted to care for it, they also exploited its ability to create matter to create Farpoint Station; the creature now in orbit is trying to help free its mate by punishing those who ensnared it.
Though Q goads Picard into punishing the Bandi, Picard refuses, instead ordering the Enterprise to fire a vivifying energy beam onto Farpoint after the station is evacuated. The beam allows the land-bound creature to transform back into its jellyfish-like form, and it flies into orbit to join its fellow beings. As the crew watches the reunion of the alien creatures, Q reluctantly tells Picard that they have succeeded in their test, but hints that they will meet again.