When I was done waiting for the evening to fall to start a specific quest by sitting on a chair for six hours, I got three messages of settlements being under attack. Since I rarely see any of them being attacked during 'normal' gameplay, I started wondering what determines the frequency of the attacks?
Is it completely random, or does the chance of happening increases when you are not doing anything? Or are there other contributing factors (if so, which?)
Update: I have full defenses on all settlements and currently play on normal difficulty. One of them even has a defense of 90+ (combined water + food: 44) and is surrounded by walls. One important reason for asking this question is that I would like to prevent fast traveling. The three settlements that got attacked are located in the corners of the map, so I had no chance to helping them all without fast traveling (you fail the associated misc. quest when not responding in time). If I can do something to reduce the chances of it happening, this would reduce that problem.