Ants have a surprising resistance to microwaves that sets them apart from other insects and small animals.
Their survival in microwave ovens is due to several unique factors in their anatomy and behavior. Microwaves work by agitating water molecules, but ants contain very little water in proportion to their body size.
In addition, their chitinous exoskeleton acts as a protective barrier against electromagnetic radiation. Their small size also plays a crucial role: they are so small that they can move between the 'hot spots' and 'cold spots' created by the wave patterns inside the microwave.
Ants also move constantly, avoiding staying in one spot where energy concentrates enough to heat them dangerously. However, this does not mean it is safe or advisable to test this, as they would eventually succumb if exposure were prolonged.
Source: Physics of Living Systems