Why do your muscles spasm/twitch?

Mus tear/irritated. Why do your muscles spasm/twitch? An injury to the muscle or its nerve supply will result in twitching or spasming. The body tries to repair the damage and as the nerve fibres are reconnecting beyond the injury site, they go through a period of twitching till they recover.