In particular, this word comes from the planet which is named for the god Mercury. Supposedly people born under the influence of the planet Mercury would have the qualities of the god Mercury, being quick-witted, lively, and unpredictable.
Related words: jovial and saturnine.
The painting below is Mercury by Hendrik Goltzius.