The word comes from the name of the Greek god Hermes (Roman Mercury), whom the Greeks associated with the Egyptian god Thoth, the god of magic and science, and he was also the inventor of writing.
In particular, the "hermetic" tradition is linked to the Thoth known as "Hermes Tresmegistos" (Mercurius Ter Maximus in Latin), the "Thrice-Great Hermes." This Hermes Tresmegistos was the supposed author of something called the Hermetic Corpus, a collection of alchemical writings. You can read more about Hermes Tresmegistos and the hermetic tradition at Wikipedia. In particular, this Hermes supposedly invented a secret seal that could make a glass tube airtight.
The images below show the Egyptian god Thoth and also a depiction of Hermes Tresmegistos from the cathedral in Siena, Italy.