E. Cobham Brewer 18101897. Dictionary of Phrase and Fable. 1898.
On one occasion Bacchus, in his Indian expeditions, was encompassed with an army far superior to his own; one of his chief captains, named Pan, advised him to command all his men at the dead of night to raise a simultaneous shout. The shout was rolled from mountain to mountain by innumerable echoes, and the Indians, thinking they were surrounded on all sides, took to sudden flight. From this incident, all sudden fits of great terror have been termed panics. (See Judges vii. 1821.)
Theon gives another derivation, and says that the god Pan struck terror into the hearts of the giants, when they warred against heaven, by blowing into a sea-shell.