
Fossil spider from the Cretaceous era
Spiders evolved from annelid worms beginning about 540 million years ago. They were among the first land creatures with more than one cell.
At about the same time, the first bigger land animals began to come out of the water: frogs and salamanders. These ate spiders.
The earliest evidence of an orb web, the round kind that is the most normal kind of spider web, comes from one that was preserved in amber about 110 million years ago, but spiders were probably making these webs as early as 135 million years ago.

An orb web
That’s because flying insects like grasshoppers and bees were evolving at this time, and so the spiders evolved webs to catch them. At the same time, birds also evolved that could eat the bees and grasshoppers – and also eat spiders.