The Doctor, alone in the TARDIS, arrives on a jungle planet and meets Leela of the Sevateem Tribe, who has been exiled for profaning their god Xoanon. The Sevateem believe Xoanan and his servants the Tesh live beyond an impassable wall, but he speaks through the shaman Neeva (David Garfield).
When Leela first meets the Doctor, she calls him The Evil One, but he does not know why. They are both captured and brought to the village, and the Doctor finds high-tech artifacts and space-attire being used as decorations or holy relics. The god speaks to Neeva through a communicator, and a sonic disruptor creates a force-field that keeps dangerous creatures away. Then he hears his own voice coming through the communicator. He realizes that the Sevateem are the descendants of the Survey Team of a colony ship, and the Tesh are the techs, still living in the ship.
Leela brings the Doctor to see his own face carved Mount-Rushmore-like into a mountain. They enter the mountain through the mouth of the figure (remember Zardoz?) and find a human in a spacesuit, or at least the image of one. In the distance is the Starfall Seven rocket which the Doctor recalls from the Mordee Expedition. They meet three of the Tesh, who worship Xoanon. Both the Tesh and the Sevateem were produced by the same insane eugenics scheme on the part of the Xoanon computer. The Doctor was there ages ago, tried to fix the computer, and left part of his own personality inside, causing the AI to become schizoid. As the Sevateem and the Tesh battle it out in the stark white corridors, the Doctor tries to repair Xoanon, part of which explodes, knocking him out. When he awakes, the computer is functioning, and he tells the Sevateem and the Tesh that it can serve their new combined society. As he tries to leave in the TARDIS, Leela pushes inside and triggers dematerialization.
Frankly, I think this story was rather ordinary Doctor Who, except for Leela. Tom Baker did not want to have a companion at all, and Leela was supposed to be one of a few temporary companions, but she was well-liked from the beginning, particularly by the lighting team who worked hard to light her perfectly in her skimpy leather loin-cloth outfit. This was also a great hit in the newspapers, and presumably among young male viewers. And older ones. But she provided an interesting contrast to Tom Baker. Most companions are there to ask questions so the Doctor can explain the science to the viewers. Leela is doing so, not because she’s a little dense like some, but because she’s innocent and a barbarian, which means the Doctor gets to lecture her on morals and human nature—for example, why you should not kill everybody who gets in your way. She was quite different from Sarah Jane, but just as brave. Leela never screamed, except once when she was about to be eaten alive by a giant rat in the Talons of Weng-Chiang. She based her character on the 3-year-old girl next door and a terrier of her acquaintance.