

It is possible that infiltrator exploded them. What comes to generators: they might not be damaged by the attack. They are usually more useful within the settlement than covering their borders. Best use for walls is to protect soft targets and narrow down enemy approach space. Some settlements - like Abernathy Farm - have annoying general spawn point in the middle of settlement area. Some groups - like the Institute - will usually teleport in anyway. Attackers will end up teleporting through, if they can't find path in.

There is no sense to try and block the settlement off entirely with them.

Walls are completely useless in the calculation, though practical with on site events. They do not get attacked very often, because I do not store excess resources to settlement Workshops. That calculation actually favors settlers, so I rarely ever bother to run, if one of my settlements happens to get attacked. Game only calculates 100 points for defense in to attack chance and victory calculation. There is a small base change for raids, which is increased by the amounts of excess food and water in your Workshop.
