The Greeks did not know the periodic table existed. For them, there were 4 elements in the world, the fundamental building blocks of nature. Earth, Fire, Wind and Water.
Aristotle first suggested that there must be a fifth element that stars were made of, since they seem to follow perfect laws of motion. On Earth, you have friction, you have wind, you have a host of factors that make perfect motion impossible. In stark contrast, the lights in the sky seem to move in absolute perfection.
He proposed a fifth element called Aether to account for the celestial bodies. This fifth element was considered a pure, fine and perfect substance.
In Latin, quinque is the number ‘five’ and quinta means fifth. Since Aether was considered the fifth element, it was also referred to as Quintessence.
This term was later adopted by the alchemists to explain how one element changes into another. They thought of it as a life force which transmutes base metals into others. Even Newton spent a considerable part of his life in the pursuit of creating Gold in this manner.
The word found its way into English through French and is used to refer to describe the purest, most ideal form of something.