The U.S.S. Enterprise comes to the planet Ardana to acquire zienite, a rare mineral needed to stop a planet-wide plague on Merak II. The zienite is not available, however, because the miner class Troglytes are rebelling against the rulers of Ardana, who live in the cloud-city of Stratos.
The Stratos-dwellers insist that the Troglytes are naturally inferior beings, but Kirk discovers that the Troglytes are being affected by a gas emitted during mining.
Unable to get both sides to settle their differences, Kirk traps the Troglyte leader Vanna and the High Advisor of Ardana's Ruling Council, Plasus, inside a mine. When the gas takes effect, Plasus realizes what is happening and promises to help the Troglytes. With peace restored, the U.S.S. Enterprise is able to secure the zienite it needs.