If you keep bullying someone all the time, at some point he will turn on you. Even the most mild-mannered person will put up with only so much. Normally, when you refer to an individual as a “worm”, what you mean is that he is an unpleasant character. But in this idiom, it is gentleness or the harmlessness of the creature that you are referring to. You are saying that the person is a weak individual.
*I wouldn’t mess with Rajeev now if I were you. He has changed. The worm has turned.
When Shakespeare used that simple phrase, “The worm has turned,” he knew his audience would understand its meaning and origin. A widely used expression even today, it indicates a reversal of fortune, but few who use it know why.
“Worm” is a common term for ‘dragon.’ In fairy tale terms, the flying dragon spewing fire would ravage fields and villages. To be in the dragon’s path resulted in inescapable destruction. What a relief if it changed directions.
The phrase persists through time and changing cultures because it describes a more ancient and universal force: the annual cycle of the sun. As time cycles through the seasons, the Dragon circles through the Zodiac. After summer solstice, when long summer days dry the earth, the Dragon ravages the land bringing drought and pestilence. As the seasons change, the worm turns