Wait so what exactly does machinery do?

Some of you say hardly any at all, another says a decent portion, and what does it regenerate, traps and abatis only, or all defences? Or just traps, abatis, and towers?