When SHTF difference between being victim or not (or being attacked or not) is mostly matter of “is it worth?” words.
So someone will attack you if they see that there is sense to attack you calculating between risk of getting harmed and how much they can gain from attack.
There is no simple rule, so sometimes there is no sense of showing to them that you are worth of attack, and sometimes there is sense of showing that they gonna pay very high price for attacking you.
Being “not worth” attacking is always first “defense”, second would be showing on very clear manner that you are capable of doing harm, and that you have will for that.

And of course strength is in numbers.