the behavior of its component elements ( ants ) is essentially mechanical , but the anthills reaction to an external event -- like a sudden flooding or an attack by neighboring ants -- is not mechanical .