Horta are silicon-based life forms that live deep beneath the surface of the planet. They are sapient and quite intelligent.
An adult is an oblong form roughly 2-3 meters long and 1-2 meters in diameter. Its surface looks like rock, but it is also flexible. In the open, they can move quickly by sliding or flowing over the rocky surfaces of the mining tunnels that the Federation miners had created. They can also burrow rapidly through solid rock by chemically dissolving stone in their path, leaving a smooth cylindrical tunnel in their wake. It's not known how horta navigate or sense their surroundings, but they seem to have good awareness of events occurring around them, even through meters of solid rock.
The horta life cycle involves a long period of incubation of their eggs. After the eggs have been laid, all but one of the horta population dies off. The single caretaker protects the eggs and raises the young when they hatch.
The Federation miners entered the rock layer in which the horta dwelled during the incubation cycle. While extracting minerals, they encountered millions of "silicon nodules" which had little value to them, and they destroyed many of these eggs during their mining operations.
The horta caretaker acted to protect the eggs, using its ability to disintegrate rock and other materials to destroy mining equipment. Due to the exceptionally rich mineral deposits of Janus 6, the miners were undeterred; they replaced the equipment and continued mining. The horta then resorted to killing miners to stop their operations. Armed only with type 1 phasers, the miners were unable to deal with these attacks, so they called Starfleet for assistance, which brought the Enterprise to Janus 6.
Armed with type 2 hand phasers, away teams from the Enterprise presented more of a threat to the horta, and it was significantly wounded by Captain Kirk and Commander Spock. Slowly dying of its injuries, the horta attempted to communicate, initiating a stand off with an isolated Kirk instead of attacking. Spock rejoined Kirk soon, and they realized the horta was intelligent, and Spock was able to communicate with it via a mind meld. They negotiated a peace, explaining that the miners did not realize that the "silicon nodules" they were destroying were eggs. Doctor McCoy was able to use some silicon-based construction materials to heal the horta caretaker's injuries, and the miners agreed not to harm the eggs once they realized what they were.
A short time later, the eggs began hatching, and the new population of young horta turned out to be extremely helpful to the Federation mining operation by opening tunnels to rich mineral deposits for the miners.