You need to pay attention to any messages you may get regarding your settlements under attack. You must fast travel to the settlement under attack to defend it. If you do not, then you fail the mission and settlers may die or equipment will be damaged or both.
No amount of defense can prevent auto failure if you do not directly intervene. If your settlement had 1,000 defense point, and settlers armed with miniguns and rocket launchers the settlement will be defeated by a single radroach.
Yeah the babysitting mechanic is something I'm hoping will get addressed via mods. It's easy to miss the settlement under attack warnings, a properly defended settlement shouldn't come under attack and lastly if they do I shouldn't need to run to them to "help defend" a location with turrets literaly lineing the walls. It's silly
I find once I have a high enough defense rating (around 10 pts per settler) this stops happening, or at least seems to happen less.
Also give your settlers decent guns. I won't let anyone have anything less powerful than a 10 mil with the best reciever (max damage).
Finally, I stash a couple charged-up suits of pwr armor at each settlement for folks to use, should needs must.
http://www.nexusmods.com/fallout4/mods/4106/? -> Changes the warning to a message box.
http://www.nexusmods.com/fallout4/mods/4180/? -> Disables them completely.