These small eight-legged creatures, known for capturing their prey in intricate webs, were evidently as common in Middle-earth as they are today. Characters in The Lord of the Rings often refer to them descriptively, whether it be Gandalf discussing his capture by Saruman, Sam climbing ropes across the Silverlode, or Gollum clambering down a rock wall.
There was a more sinister side to the spiders of Middle-earth, though, that entered it with the monstrous Ungoliant in the years before the First Age. A gigantic creature of spider-shape, it was she who destroyed the Two Trees of Valinor, and escaped with Melkor into the lands of Middle-earth. Though Ungoliant herself disappeared into the far south, she left the northern lands infested with her offspring. During the First Age, the mountains of the Ered Gorgoroth were infested with these monsters, and became a place of dread.
The most famous of Ungoliant's children, though, lived far to the south and east of the Ered Gorgoroth, on the borders of the land of Mordor. This was Shelob, who haunted a network of tunnels watching the pass of Cirith Ungol, eking a living on the hapless Orcs of Sauron. She had offspring of her own, too, smaller than she but with a cruel intelligence, that spread throughout the Ephel Dúath and north into Mirkwood. It was creatures like these that Bilbo encountered in The Hobbit, and through fighting them that his sword acquired its name Sting.