The Cloud Minders episode of Star Trek
In order to save an inhabited planet from being destroyed by a botanical plague, the Enterprise goes to pick up zenite, the mineral cure, on the only known planet where it is mined. When Kirk and Spock beam down, they are attacked by ‘troglites’ (troglodyte miners) but not captured. High council adviser Plasus intervenes and brings them to Stratos, a luxurious metropolis which literally floats in the sky. However, it is under attack from ‘disruptors’, troglite revolutionaries who want equal life conditions for their peers. They do all the hard work, mainly toiling miserably in mines and dwell in caves on the barren surface below. Dr. McCoy ascertains that the alleged intellectual inferiority of the troglites is not genetic but the reversible effect of exposure to an invisible gas emitted by the zenite.