So the first thing to consider is that anarchy is a very diverse field of thought, so there isn’t one answer to questions about it.
An anarchist society faced with violence from outsiders could:
Form militias on a voluntary basis. Transitive hierarchical structure can be voluntary and compatible with anarchism (think of a volunteer fire department). Remember, the key is such efforts are not coercive in an anarchist community, they are voluntary and collaborative so they require the community having the will to organize for its own defense.
Employ decentralized resistance / guerilla warfare. This can be extremely effective.
If allies and neighbors are watching, engage in nonviolent resistance. This is difficult and requires getting the message out to other groups and the attacker’s constituency to pressure them.
Diplomacy. Anarchists generally don’t support representationalism and prefer consensus, but communities can choose to empower diplomats and make deals with others when the time calls for it. This could be with other anarchist communities, other states to ask for aid, or even with the attacker. Building solidarity with like minded and compassionate communities can endanger the attacking group’s reputation and resources, and can be a powerful deterrent to an aggressor.
Remember that an attacker wants something. If they aren’t getting what they want out of a conflict, or if the costs are greater than what is gained, they are likely to stop pursuing it. Anarchist communities likely have different values, and resource extraction is the most likely reason to attack such a community; making it extremely difficult or impossible to do that is something an organized community can achieve.
Think about Vietnam; while Vietnam was and is not anarchist or non-hierarchical, a decentralized military strategy with deep support from the population led to victory over a technologically superior invader. For an example closer to anarchy, you can read up on the Zapatistas, who employed decentralized resistance to the Mexican government and won.
Last, I want to add that the above is more or less true of any community or country that is attacked by a larger force, whether they are communist, or capitalist, or stateless. Economic and social structure are not going to protect any group from being attacked, and doesn’t guarantee victory no matter how organized the defense may be.
So the first thing to consider is that anarchy is a very diverse field of thought, so there isn’t one answer to questions about it.
An anarchist society faced with violence from outsiders could:
Remember that an attacker wants something. If they aren’t getting what they want out of a conflict, or if the costs are greater than what is gained, they are likely to stop pursuing it. Anarchist communities likely have different values, and resource extraction is the most likely reason to attack such a community; making it extremely difficult or impossible to do that is something an organized community can achieve.
Think about Vietnam; while Vietnam was and is not anarchist or non-hierarchical, a decentralized military strategy with deep support from the population led to victory over a technologically superior invader. For an example closer to anarchy, you can read up on the Zapatistas, who employed decentralized resistance to the Mexican government and won.
Last, I want to add that the above is more or less true of any community or country that is attacked by a larger force, whether they are communist, or capitalist, or stateless. Economic and social structure are not going to protect any group from being attacked, and doesn’t guarantee victory no matter how organized the defense may be.