The reference is to the Lernaean Hydra, a legendary monster in Greek Mythology that Hercules killed. The Hydra was a snake-like monster with many heads; and if you cut off one head, two more would grow in its place.
As Nikos Tsiforos‘ humorous retelling of Greek Mythology put it, Hercules’ reaction when he observed this was:
Dammit, this monster’s just like the Tax Department during an audit.
And indeed, the Hydra is a good metaphor for a situation where many things are going bad (lots of heads), and where trying to make things better only makes things worse (chop one head off, get two more heads).