Complex sentence: The flies are able to parasitise healthy ants if the ants are artificially restrained, but healthy ants are agile and able to repel them.
Split into simpler sentences: The flies are able to parasitise healthy ants. If the ants are artificially restrained, but healthy ants are agile and able to repel them.