The giant spider defeated by Samwise Gamgee in J.R.R. Tolkien’s legendarium is Shelob.
Shelob appears in The Lord of the Rings as an ancient creature living in a pass near Cirith Ungol. She attacks Frodo and Sam while they are trying to reach Mordor. Shelob poisons Frodo, but Sam uses Sting and the Phial of Galadriel to drive her away and then confronts her again.
Shelob is described as a descendant of Ungoliant, a much older monstrous spider from Tolkien’s earlier mythology. Ungoliant helped destroy the Two Trees of Valinor and later became associated with insatiable hunger. Shelob is not the same character as Ungoliant, and the name Lobelia refers instead to Lobelia Sackville-Baggins, a hobbit.