The poetic device this sentence is using is metaphor.
Metaphor is a rhetorical figure of speech which you use when you want to compare two or more things, without using words such as like or as. So, her irritation wasn't really an anthill overflowing with ants, but rather similar to it, but the author wanted to use a symbolic way to portray this comparison.