The advice to always keep your finger out of the trigger guard when you are not cutting is very good advice to keep in mind. I had a near miss about 4 years ago that scared the **** out of me and prompted me to buy a pair of chaps and wear them.
I bought a semi load of 8' logs for firewood and was cutting them up, I had been working most of the day and was tired. A wood chip got between my safety glasses and my cheek, so I set the tip of my bar on a log about waist high, let go of the saw with my left hand to wipe the chip off my face, a log in the pile shifted along with the log my bar tip was on, your natural reaction is to grip the saw, the bar went by my right knee with the saw at wide open and missed my knee by about 2 inches. The weird thing is it didn't really sink in and scare me as much at the time, it was about an hour after I was done I started thinking about it more it really shook me up.
You experienced first hand(pun intended) a Sympathetic Muscle Reaction. The technical explanation here arose from investigation of involuntary firearm discharges by police. Oddly enough, many of these reactions are also result of noise or light, not just a loss of balance:
"The term sympathetic contraction refers to the fact that an involuntary contraction may occur in the muscles of one limb when the same muscles in the other limb are performing an intended forceful action. In physiology literature this effect is known as a mirror movement, with the intensity of the sympathetic contraction depending on the amount of force exerted during the intended action. In policing, a common situation that may evoke such a sympathetic contraction would be, for example, a law enforcement officer attempting to restrain a struggling suspect with one hand while holding a handgun in the other."
"the possibility of involuntarily discharging a firearm, but also offered explanations as to their possible causes: involuntary discharges, Enoka proposed, may result from involuntary muscle contractions in the hand holding a firearm. All human movements (and thus also the flexion of the index finger when pulling a trigger), so Enoka, are based on muscle contractions, which are generally caused by a direct command from the brain (known as a voluntary contraction).
However, muscles can also be activated by signals that arise from other locations within the nervous system besides the brain, and such activation may produce a muscle contraction that is not the result of a conscious decision. This is especially likely to occur when the human body has to react quickly to an unexpected incident, for instance (as is illustrated at the outset) a light flashing directly in front of an individual. According to Enoka, there are three scenarios that may elicit involuntary muscle contractions that are sufficiently strong to bring about the involuntary discharge of a firearm: sympathetic contractions,
loss of balance and startle reaction."
"Startle reaction, is a whole-body reflex-like response to an unexpected stimulus, possibly a loud noise. It evokes rapid involuntary contractions that begin with the blink of an eye and spread to all muscles throughout the body. The reaction of the hands occurs less than 200ms after the stimulus
and leads to individuals clenching their fists. Enoka concludes: "Accordingly, an officer who is startled by a loud, unexpected noise while searching for a suspect with his weapon drawn would surely increase the grip force on the weapon, perhaps enough to cause an involuntary discharge."
Anyway, the quotes above are from a pretty good article on the phenomenon where the 'theory" was actually tested and documented:
Involuntary Firearms Discharge: Does the finger obey the brain? - Law Enforcement News
Kinda long, but extremely interesting and very applicable to "us" chainsawers