This moment — Spock’s mind-meld with the Horta in “Devil in the Dark” — is the instant when the socialist Federation of “Star Trek: The Next Generation” with all its hope becomes possible.
Throughout the original series of Star Trek and in Enterprise people are constantly mining stuff. We see a galaxy desperate for mineral wealth, and the realpolitik of this shortage leads to enormous misery.
On Coridan, Vulcans prop up a puppet government (ENT, “Shadows of P’Jem”) while Orions raid the planet for its dilithium and Tellarites mine it illegally (TOS, “Journey to Babel”). Federation battles with the Klingons on Capella IV (TOS, “Friday’s Child”) and in the Tellun system (TOS, “Elaan of Troyius”) are spurred by the presence of mineral resources, and Federation mining negotiations with the Halkans fail because of the Halkans’ fear of what the Federation might do with their minerals (TOS, “Mirror, Mirror”).
The condition of Federation miners in general is clearly one of superexploitation. The Federation, needing zenite, admits Ardana as a member despite the elite of Stratos forcing the Troglyte miners below to work without even the most basic equipment (TOS, “The Cloud Minders”). Lithium miners on Rigel XII work for years in poverty conditions without seeing any people from outside (TOS, “Mudd’s Women”).
Note that above I have named seven TOS episodes out of 79 — exploitation in mining is a major theme of the 23rd century Federation. In most cases the demand for minerals is explicitly stated as being for either constructing starships or supporting colonization.
By the 24th century the Federation seems to have overcome this problem. While mining is still dangerous (TNG, “Hide and Q”) and the Federation is still prospecting for new resources (DS9, “The Sword of Kahless,” “The Ship”), the only miners we see working in exploitative conditions are the holographic EMH mark Ones not yet recognized as sentient (VOY, “Author, Author”). Conflict with other states over mining rights seems to have vanished.
Meanwhile by late 24th century the Federation’s neighbors all go through severe political turmoil as a result of resource shortages. The explosion of Praxis due to energy mining operations triggers Klingon demilitarization and detente with the Federation (Star Trek VI), the Cardassian Union’s transformation into a dictatorship begins with the exhaustion of Cardassian mineral resources (DS9, “Duet”), and Shinzon’s coup against the Romulan senate is part of an uprising by Reman dilithium miners (Star Trek Nemesis).
In a Marxian sense exploitation is inherent to the existence of profit: an exploited miner produces more wealth than they receive in wages. Advanced automation does not elimination the problem — in fact, it exacerbates it.
The mining facility on Delta Vega (TOS, “Where No Man Has Gone Before”) may be fully autonomous, but this simply means the labor-power of the people managing the cargo ships and maintaining the facility is incalculably more valuable compared to what they receive for their work. As long as supply of basic needs is exceeded by demand the problem is intractable even if the Federation as a whole is no longer a capitalist society — the opportunity to hoard wealth and the need for some form of rationing or market system persists.
The Horta cut, or should we say dissolve, this Gordian knot.
For a humanoid miner, labor and survival are separate but mutually dependent processes. In a fully capitalist society a person must carry out productive work, or some temporary substitute, to receive food, housing and other basic needs to survive and work another day; this cycle is what makes exploitation possible.
For a Horta, survival and the extraction of mineral resources are identical processes — the abundance they need is space to grow, space the Federation can easily provide by helping the Horta colonize other planetoids across their space — and there are plenty of worlds that, for humanoids, are just barren rocks, but that are new idyllic frontiers for the Horta.
Thus the cycle of exploitation is broken, and once it breaks somewhere in a society it breaks everywhere.
What remains for the Federation is the quandary faced by the Soviet Union in the 1920s. Will some state caste (Starfleet? Section 31?) put their interests ahead of the interests of the whole society, choosing to perpetuate inequity even among the potential for abundance?
The Federation at the end of the 24th century is a place capable of creating starships nearly at the touch of a button, fulfilling the needs of all its billions of citizens, and acting with the greatest generosity to its neighbors, even its enemies.
The great horror potentiated by this wealth: the possibility — as we see in “Picard” — that it might choose not to.