From Tolkien Gateway

Ants are tiny insects that form large communal colonies under the rule of a single queen.

Though unmentioned directly in The Lord of the Rings, the presence of ants in Middle-earth may be deduced from the question that Merry put to Pippin when they were trying to sleep after the parley at Isengard. Pippin was restless, twisting and turning about, which prompted Merry to ask, "What's the matter? Are you lying on an ant-hill?"[1]

On other occasions the servants of Sauron are compared to ants: From the Seat of Seeing on the summit of Amon Hen Frodo could see that the "Misty Mountains were crawling like anthills: Orcs were issuing out of a thousand holes".[2] When Frodo, Sam, and Gollum first looked upon the Morannon, it is mentioned that the hills behind the gate were tunneled with hundreds of caves filled with Orcs, "ready at a signal to issue forth like black ants going to war."[3] At the moment of Sauron's downfall it was said:

"As when death smites the swollen brooding thing that inhabits their crawling hill and holds them all in sway, ants will wander witless and purposeless and then feebly die, so the creatures of Sauron, orc or troll or beast spell-enslaved, ran hither and thither mindless..."[4]