In the example in the photo above, Abernathy Farm has 17 in Food and 15 in Water, which means that at 27 Defense, they are at a 5 Defense deficit.
If you have 10 in Water and 15 in Food, that means you need 25 in Defense, even if you only have 3 settlers. Since you have to repair those items by lugging food and equipment back to the site, using resources you could have otherwise used to build more defenses, it makes sense to have your settlement adequately defended in the first place. That is why a neglected settlement, one that has been through a battle without your assistance, will often have destroyed crops and water pumps. Food and water are the commodities that make your settlement attractive to would-be invaders like Gunners, Raiders, and Super Mutants.
If you’ve been building up tons of turrets and posts and have no idea why your settlers still aren’t satisfied, here’s why: your defense needs to be equal to the sum of your food and water. Initially I thought the amount of defense your settlement has had to be equal to the amount of settlers living there, but I was wrong. Like me, you may be wondering exactly what the secret formula is behind the defense system for settlements in Fallout 4.