The Enterprise is exploring uncharted planets on the edge of the galaxy. Accompanying them is Honorary Commander Ari bn Bem of the planet Pandro, a recently encountered civilization considering Federation membership. The Enterprise arrives at Delta Theta III, a Class M planet with reports of aboriginal inhabitants. A landing party of Kirk, Spock, Scotty, and Sulu prepare to beam down to plant monitor devices, and Kirk makes it clear theyâ€™re to avoid any contact with the natives. In the transporter room, Bem is waiting for them while programming the transporter controls. He insists on going with them despite the fact that heâ€™s remained in his quarters during the last six off-ship expeditions. Kirk warns that keeping the commander safe is his responsibility but Bem insists on going regardless.
The landing party beams down on a small cliff next to a lake. Kirk and Spock materialize just over the edge and drop into the water a few feet below. Bem leaps into the waist-high water and offers his assistance. Theyâ€™re unaware that the bottom half of Bemâ€™s body has detached and extended a pair of hands, which switch Kirk and Spockâ€™s phasers and communicators for fakes. Once the switch is made, Bemâ€™s two halves reunite, concealed by the water, and he emerges with the others. Kirk tells him to leave the transporter controls to Scotty in the future.
Aboard the ship, Lt. Arex detects an unusual sensor anomaly which resembles a sensory web. The anomaly is several thousand kilometers away from the landing party but Uhura notifies Kirk of the readings. Spock speculates that the readings represent some form of intelligence. They enter a nearby rain forest while Spock notes that the vegetation and geology suggest the planet is much younger than the sun it orbits. Bem detects life signs on his tricorder and then runs into the rain forest. Kirk and Spock follow him into a dead end of underbrush but Bem secretly separates and makes his way through. The officers discover their way cut off and go around. They catch up to Bem just in time to see the natives capture him.
Uhura contacts Scotty to notify him that the anomaly is increasing in activity. She orders him and Sulu back to the ship per Kirkâ€™s standing orders, and then discovers sheâ€™s unable to contact Kirk and Spock. On the planet, Kirk and Spock discover their equipment has been replaced with forgeries and they canâ€™t contact the ship. Kirk has no choice but to rescue Bem. They follow the natives to their village and then slip into the camp to the cage where Bem has been imprisoned. Bem explains that he allowed himself to be captured so he could observe the natives up close. Kirk and Spock open the cage but the natives capture them as well.
As they wait, Bem notes that Kirk has failed to prove himself a competent captain and that the people of planet Pandro will be dissatisfied. When Kirk points out that Bem has stolen their equipment and endangered all their lives, Bem demonstrates his ability to split his body into separate entities, and Spock realizes that heâ€™s a colony creature. As Bem slips through the bars of his cage and returns their equipment, he explains that his assignment was to test Kirk to see if he was of value to Pandro. Once freed, Kirk places Bem into protective custody.
The sensory anomaly has now spread to cover the entire planet. Kirk, Spock, and Bem try to escape but the natives intercept them. Kirk prepares to fire his phaser but the anomaly appears as a glowing energy field and immobilizes them. The alien entity speaks, asking why they are on its planet interfering with its â€œchildren.â€ Kirk explains that they are there to classify and test the planet but the alien entity insists that he has no right. She neutralizes their weapons and the natives recapture them.
As Scotty prepares to send down a rescue party, Bem informs Kirk that he considers the captain inadequate and that his own life doesnâ€™t matter. He splits up again and escapes. Spock suggests they contact the alien entity but one communicator isnâ€™t sufficient. Spock hooks to of them up in series for a brief high-power burst and Kirk manages to contact the alien entity. He apologizes and says that he will tell his people to avoid the planet from now on. The entity agrees but refuses his request to look for Bem, who is no longer present. Once it fades away, Kirk contacts the ship and orders Scotty to beam down a team to search for Bem. He gives them orders to only use their weapons on the lightest stun setting. The natives attack and the landing party drives them back, and then finds Bem.
As Bem apologizes for his poor judgment, the alien entity reappears. It is angry that Kirk has remained there but the captain explains that it was his responsibility to rescue Bem. Bem insists that since he has erred, he must divide into his separate components for good, essentially committing suicide as a sentient individual. The alien entity says that if he does so, he canâ€™t learn from his mistakes. When he wonders if it will punish him, it insists that there is no need for punishment among civilized beings. It tells them to leave before it contaminates its â€œchildrenâ€ with such concepts.
As they depart, Kirk contacts Starfleet to have the planet placed under quarantine. Bem agrees that Pandro will do the same. Spock wonders if the alien entity was in fact some form of god, using the planet as a laboratory to experiment on a civilization. As they leave orbit, the alien entity contacts them long enough to say that they have learned much.