The hexagram is based on the gestalt triangle. The earliest examples found are dated back to around 800-600 B.C.E. Present historical facts state that the hexagram appeared at least 3000 years later than the pentagram.
During antiquity the hexagram was a symbol of the Jewish kingdom. When this kingdom was conquered in 70 c.e., and, in fact, already some 100 years before that, the Jewish people began to spread throughout the world, as did the hexagram symbol.
The hexagram is sometimes known as the shield of David or the Magen David. According to some, the Muslims refer to the hexagram as Solomon's seal, whereas others point out that the sign on Solomon's seal was a pentagram. The hexagram is frequently used in the magic formulas in the ancient book of witchcraft, The Key of Solomon.
The hexagram was first and foremost used by alchemists in the Middles Ages as a general symbol representing the art of alchemy and secondly as a sign for water (inverted triangle), and fire (regular triangle). Together, these two signs formed the symbol for fire water or the essence, or spiritus, in wine: alcohol. It was also the sign for the quintessence, the fifth element. However, in some alchemical contexts the hexagram was used to mean drink!
The Jews in Europe used the hexagram during the Middle Ages on their banners and prayer shawls.
The hexagram became more popular during the nineteenth century and was used to decorate newly built synagogues. The founders of the Zionist movement adopted the hexagram as a rallying symbol in their attempt to create a Jewish national state in Palestine.
(source: Dictionary of symbols, published 1991)
(Website used: http://oba.users3.50megs.com/ec/symbols.html)