What is the meaning of [Even a worm will turn]

Even the humblest and weakest will retaliate if provoked sufficiently.

The proverbial saying ‘a worm will turn’ is first found in John Heywood’s 1546 glossary A dialogue conteinyng the nomber in effect of all the prouerbes in the englishe tongue:

Treade a worme on the tayle, and it must turne agayne.

Even a worm will turnShakespeare, never one to avoid borrowing a neat expression, used the same notion a few years later in Henry VI, Part III, 1592:

Who ‘scapes the lurking serpent’s mortal sting?
Not he that sets his foot upon her back.
The smallest worm will turn being trodden on,
And doves will peck in safeguard of their brood.

Note that Shakespeare used serpent and worm in that passage. Snakes were called worms in medieval England. For instance, in Anthony and Cleopatra Shakespeare refers to “the pretty worme of Nylus” [the pretty snake of the Nile].