In the case of the Spanish civil war, the problem was that the communists and the fascists both wanted them killed, and so with some effort they succeeded.
Not just in Spain, in USSR and elsewhere too.
In fact the ideological enmity between communists and anarchists starts even back at the time of Bakhunin and Marx (and they were many critiques from one to another).