The Doctor discovers in the sleeping quarters electrical equipment which broadcasts subliminal suggestions & orders during peoples sleep. This is used as part of the regime of maintaining conformity.
It turns out the Macra, the big clawed insect monsters, are the indigenous inhabitants of the planet and that they need the gas to be in the atmosphere for their survival. And that the Macra were the ones maintaining the whole control system to keep the people occupied with the profession of mining and distributing the gas.
Eventually the Macra are exposed to the humans and their control of the colony was ended. A fun series of scenes had the Doctor and Polly in a control room with all these pipes controlling the flow of the gas. Jamie had wandered into an "old tunnel" and the Controller had ordered gas to be sent into that same tunnel, and the Doctor was madly but slyly studying the pipes to determine which would turn off the gas going to Jamie's old tunnel. Once he figured it out a little sleight of hand and not only did he change the pipe settings, but the control room operator was locked out of his control room.
This story strikes me in several ways.
The gas being mined is a great analogy of fossil fuels. Like the gas the use of fossil fuels is changing our atmosphere to our collective detriment.
An especially eerie scene had a group of cheerleaders practicing their song and dance routines. Their job was to maintain a jolly happy upbeat atmosphere for the humans so the humans would keep working. Strikes me as similar to the distractionitis perpetrated by mass media to keep the people occupied by distractive events and ignore the real dangers going on in the world.