The Worm Has Turned

What does the idiom “the worm has turned” mean?

Definition: a person or group that has been mistreated becomes angry and seeks revenge

Example: After years of putting up with management abuse, the workers are striking at a crucial time. The worm has turned.