A trap can be crafted with 80 wood in a workbench.
When a non-clan player, a ghoul or a non-clan bot walks on one of your traps and therefore triggers it, he will be slowed down and takes 5 damage per second. Be careful: A triggered trap also hurts the builder, his mates and his own bots! So it´s a good advice not to combine bots and traps in the same area.
It can be destroyed quickly with a hammer or golden axe/pickaxe.
Doors won´t open if such a wooden spike trap (activated or not) is set at the same place where the door would go when openend.
Triggered traps disappear by themselves after a certain period of time.
The trap is often underrated: The disadvantage is, that it costs a lot of wood and some time to get crafted. But the big advantage is that players with less equipment (weaponry/armoury) can defend their base forceful and even sometimes are able to kill stronger equipped players who underestimate the slowdown. As an e.g. if base-exits are build tunnel-like, all wide-range weapons (sniper, crossbow, spear) become a deadly tool for any trapped player. At least you might get enough time to flee, if some laser-savage wants to wipe you out.
Another thing very important to mention: If you destroy walls/doors in a house, and you don´t want these to respawn to keep the passage open, you got to set a trap there. It´s not enough to put a floor-tile there! Certainly you can set your own doors instead but sometimes you don´t want this for faster movement between rooms.