“Spiders are common mobs that can be neutral or hostile depending on the light level.”
Spiders spawn in the Overworld in light levels of 7 or less. They can also spawn from spawners in Dungeons.
Spiders have the ability to climb vertical walls. A great defense against Spiders is to build a wall and at the top, build one block out (like an overhang) where Spiders can’t climb past.
The Minecraft Wiki is not affiliated with this website in any way. All credits for the images and the text go to them.