A hideous monster strikes from the darkness, viciously murdering its victims and leaving behind nothing but badly charred remains. The Enterprise crew arrives at Janus VI, the mining colony terrorized by these attacks, and discovers that the monster feels the same way about the human miners as they do about it; it turns out that the miners have been unknowingly murdering the monster's kindred and what seemed at first to be a series of unprovoked attacks motivated by cruelty and evil was actually part of a desperate campaign of guerilla warfare intended to drive the colonialgenociders from the planet's surface.
By then, the monster, a silicon-based life-form which calls itself a Horta, has been badly wounded by phaser fire from Kirk and Spock and is weak to the point that it is now easy prey for the vengeful miners, who somehow manage to overpower, while armed only with sticks and other makeshift clubs, a supposedly elite and armed-to-the-teeth security detail from the Enterprise which stands between them and bloody (?) revenge.
The miners are stopped from beating (!) the Horta to death when Kirk yells out desperately in rebuttal to the miners's statement that the creature has killed fifty of their own that it was only answering in kind for the murder of thousands of its own kind.

A few carefully chosen words from Kirk and a would-be lynch mob turns remorseful...and their priorities shift from vengeance to avarice

At which point, the miners recognize that it was all a big misunderstanding and form a deal with the Horta in which it, and the thousands like it which will soon hatch from the eggs that the miners had been destroying, will help the miners dig for the rich deposits of pergium, gold, platinum, etc. for which Janus VI is famous and everyone lives happily ever after.

If you take the story at face value, the rapid about face in the collective mood of the miners when the rationale behind the Horta's attacks is revealed to them is too unbelievable to take seriously. These miners aren't real people; they're icons of a human race that is capable of more compassion and objective reasonsing than human beings today..because human beings now would have brushed aside Kirk's and Spock's arguments in defense of the Horta and attempted quite gamely to beat the silicon-based creature to death.

The story is also unbelievable when one considers the deal brokered between the (accidentally) genocidalcolonists and the Horta – the Horta get to help the colonists get rich by plundering Janus VI's natural resources...and in return, the "inoffensive" Horta get to keep living. It's sort of a bizarre allegory of colonialism where the natives cut short their uprising and decide to accept their lot in life to serve their "betters".

And somehow, we're supposed to buy into the fact that this is a good thing.

The colonial overseer of Janus VI gleefully reports the profits reeped in no small part due to the efforts of the now pacified native population – all the Horta ask for in return for their toil is that they get to keep living