Panic is named after a god who was blamed for frightening noises in the wilderness.
Pan was the Greek deity of woods and fields and a protector of shepherds. Etymonline says people blamed him for mysterious sounds that spread groundless fear through herds and crowds.
The Greek adjective panikon simply meant "of Pan." It is an adjective derived from his name. Over time it came to describe the fear he supposedly caused. It passed into Middle French as panique in the 15th century and from there into English.
English used it first as an adjective, to modify words like fear and terror. Merriam-Webster dates this to about 1586 and Etymonline to the early 1600s. The noun, meaning a sudden, widespread fright, is dated 1612 by Merriam-Webster and 1708 by Etymonline. Merriam-Webster and Dictionary.com both confirm the route from Pan through Greek panikos to French panique. The word then spread into new areas, according to Etymonline:
- a financial panic, meaning widespread anxiety among traders, in 1757
- panic-stricken in 1804
- panicky in 1865, during the American Civil War
- panic attack in 1970
The verb is later still. Merriam-Webster dates it to 1780. Etymonline dates to panic in the sense of throwing someone into a panic to 1827, and the modern intransitive sense, "to lose one's head," to 1902.
Panic button has its own story. Etymonline says jet pilots used it figuratively in 1948, while the literal prison-security sense dates from 1965.
One warning: there is a second, unrelated panic in English. It is a name for a type of grass and comes from Latin panicum, a kind of millet, and Dictionary.com records it from 1375 to 1425. It has nothing to do with the god.
The origin of Pan's own name is uncertain. Etymonline offers a link to Sanskrit pusan, a guardian of cattle, and to a Proto-Indo-European root meaning "to protect," but notes that others doubt it.