In the published Silmarillion the spider-demon Ungoliant, ancestor to The Lord of the Rings‘ Shelob, is represented as a Maiar (i.e., a subordinate angelic deity) who had once been in the service of Melkor:
The Eldar knew not whence she came; but some have said that in ages long before she descended from the darkness that lies about Arda, when Melkor first looked down in envy upon the Kingdom of Manwë, and that in the beginning she was one of those that he corrupted to his service. But she had disowned her Master, desiring to be mistress of her own lust, taking all things to herself to feed her emptiness…
While the Elves generally are said not to know from “whence she came,” some of them (presumably the “wise”) believe her to be an originally created even if an erstwhile grossly corrupted being. This “mature” understanding of Ungoliant, however, seems to represent something of a pious theologization of Tolkien’s original conception of this malevolent force. In her first appearance, found in The Book of Lost Tales, Ungoliant is “Wirilóme,” or “Gloomweaver,” a creature (as John Garth puts it) whose “provenance is a mystery even to the Valar,” and of whom Tolkien writes:
Mayhap she was bred of mists and darkness on the confines of the Shadowy Seas, in that utter dark that came between the overthrow of the Lamps and the kindling of the Trees… but more like she has always been. (Lost Tales 152, cited in Garth 258)
From her origin as a putatively timeless and authentically evil force, to her re-conception as a horribly fallen yet primevally created and therefore presumably good being, we witness the character of Ungoliant in Tolkien’s legendarium undergoing a development from Hesiodic mythos to Augustinian theo-logos.