En route to the fifth planet of a neighboring system, Voyager's crew encounters Neelix, a Talaxian scavenger. He explains that the Array has been bringing ships into the region for many months. Neelix guesses that the "Caretaker," who controls the Array, may have sent the missing crewmembers to the Ocampa, a race that lives two miles below the surface of the fifth planet. Neelix volunteers to be their guide and they accept.

Meanwhile, Kim and Torres are being cared for in the Ocampa medical facility. Although they now live in a subterranean society, the Ocampa inhabited the planet's surface until it was struck by an environmental disaster 500 years ago. Since that time, they have lived underground, with all their needs provided by the man they refer to as the Caretaker.

Beaming down to the planet's surface, Neelix introduces Janeway to the Kazon, a savage alien species that has taken possession of the arid Ocampan world. Janeway asks Jabin, the Kazon leader, if he can help them, but he refuses.

Neelix is hoping Jabin will trade Kes, an Ocampan woman he is holding captive, for some of Voyager's precious water. But the Kazon are more interested in obtaining all of Voyager's technology — forcibly. When Jabin tries to take the crew hostage, Neelix helps them escape and beam back to the ship, along with Kes.

Kim and Torres persuade an Ocampan nurse to show them a route that could lead to the surface. On Voyager, Kes agrees to lead Janeway and the others through the tunnels to her underground city to search for the pair.

As the Array increases the rate of the energy pulses that power the city, Kim and Torres begin their journey, narrowly missing the search party from Voyager. Tuvok theorizes that the increased activity of the Array may indicate that the Caretaker is dying; he is clearly attempting to give them a surplus of power that will sustain the Ocampa after he is gone.

The search is complicated by a new turn of events. The Array is now firing a weapon at the planet to seal up all of the energy conduits, the tunnels that provide the only access to the city. This will protect the Ocampans, but prevent the others from escaping. Splitting up, Paris, Neelix and Kes find Kim and Torres, and send them up to Voyager. Then Paris and Neelix go back for Janeway, Tuvok and Chakotay. Chakotay's skepticism towards Paris' loyalty is erased when Paris saves his life.

Returning to the Array, Janeway again encounters the old man, whom she realizes is the Caretaker. He explains that he was bringing beings from across the galaxy to the Array in the hopes of finding a compatible species with which he could procreate, thus providing the Ocampa with someone to care for them after he dies. But no species has been a match so far.

Janeway tries to convince the Caretaker to send Voyager and the Maquis ship back home, but he refuses. Apparently, the Caretaker wants to destroy the Array so that it won't fall into the invading Kazon's hands. But he dies before he can carry out his plan, and Janeway is left to decide whether to use the Array to get home — which would leave it intact for the Kazon — or to destroy it and save the Ocampa. She chooses what seems to be the only moral option and makes a mortal enemy of the Kazon.

With Chakotay's ship destroyed in the battle with the Kazon, Janeway asks the Maquis to become part of Voyager's crew. She also allows Neelix and Kes to stay aboard. With Chakotay her First Officer, Tom Paris reinstated as a Starfleet lieutenant, and Torres and Kim cured by the Emergency Medical Hologram, Janeway and her new crew set course for the long trip home, 70,000 light-years away.