Why do my eyes twitch? Eyelid twitching, medically known as myokymia, is usually harmless but can be frustrating. Common triggers include stress, poor sleep, caffeine, dry eyes, and ocular irritation. Although magnesium deficiency is often suspected, it is rarely the proven cause. Learn what causes involuntary eyelid spasms, how to relieve them, and which warning signs may indicate an underlying neurological condition requiring medical evaluation.