Of all the children of Ungoliant, Shelobwas the greatest. A force of primal evil in the form of a great spider. Somehow, Shelob escaped the ruin of Beleriand and she and her offspring dwelt in the forest of Mirkwood. Eventually, Shelob made her way to the Mountains of Shadow and made herself a vast lair in the Pass of Cirith Ungol, high above the fortress of Minas Morgul. For two ages of Middle-Earth, she lived there, feeding on Men, Elves and Orcs. Sauron knew of her presence and tolerated it, since Shelob made a better guard for the Pass of the Morgul Vale than any Orc. Sauron even fed her, sending prisoners to her that he no longer had use for.
During the Third Age, Shelob trapped Gollum, but released him on the condition that he bring her food. Several years later, during the Quest of Mount Doom, Gollum guided Frodo Baggins and Samwise Gamgee to Shelob's lair, where he planned to take the One Ring for himself after she killed them. Shelob paralyzed Frodo, and was going to feast upon him when she herself was blinded and stabbed by Sam, who used the Phial of Galadriel and Sting. Shelob retreated into her lair, and likely perished soon after.