Shelob was the offspring of Ungoliant, who was the first of the Great Spiders. Ungoliant's origin is unknown, as is her fate. However, it was said that Ungoliant's appetite was insatiable to the point that she devoured herself eventually.
Ungoliant, the mother of Shelob was a Maia or other being of spirit who took the physical form of a monstrous spider. Due to the killing of the Two Trees she became powerful enough to frighten even Melkor. In Middle-earth, Ungoliant spawned other demon-spiders, including Shelob. Shelob herself had children that inhabited the Mountains of Shadow and Mordor.