When these countries become arenas for militancy, the repercussions reverberate far beyond their borders