To lose one’s temper suddenly and unexpectedly, or, if you want all the synonyms I could find: flip one’s lid, throw a fit, have a fit, hit the roof, combust, blow up, blow one’s stack, blow a fuse, go ballistic, lose self-control, become enraged.
The phrase is American and first found in print in Thomas C. Haliburton’s The Attaché; or, Sam Slick in England, 1843/4:
“He flies right off the handle for nothing.”
The allusion is to an axe flying off its handle. Imagine a woodsman chopping a tree with an axe, and the metal part, or head, suddenly flying off the handle. It would happen very quickly and, if you were standing in the right spot, you could be badly hurt. Likewise, when someone figuratively flies off the handle, it can be dangerous to be around that person.
The phrase suggests irrationality. One who flies off the handle isn’t thinking clearly and is likely to regret it later. Thus, ‘flying off the handle’ has become associated with an uncontrolled, dangerous and violent anger, much like the uncontrolled, dangerous and potentially violent flying of the axehead.
The phrase reminds me of high school days when we played baseball on the school grounds. I was popular as a batter because, if I connected, the ball went far and fast. However, if I did connect, I let go the bat, which flew off to my left, and was off and running toward first base. The flying bat never hit anybody, probably because my team-mates quickly learned to stand on my right side.