Thorin's company encounters the spiders in the deep forest of Mirkwood in chapter eight, "Flies and Spiders" of The Hobbit. This conflict is significant for two main reasons: 1) the spiders incapacitate the dwarves, causing them to be easily captured by the elves, and 2) Bilbo's fight with the spiders increases the hobbit's self-confidence in his own abilities.
The incident with the spiders had left the dwarves tangled up in sticky webs and drowsy-minded from the spiders' poison; as Bilbo rounds up and chases away the last of the spiders, the dwarves realize that Thorin is missing. The woodelves had "come to him, bound him, and carried him away" (151). The distraction of the spiders left the dwarves vulnerable to capture by the elves.
Yet the ordeal with the spiders has a positive outcome, for Bilbo realizes his own worth. He defeats the great spider all by himself "without the help of the wizard or the dwarves or of anyone else," which "made a huge difference to Mr. Baggins" (142). Bilbo gains confidence as a result and feels "much fiercer and bolder" (142).