Baphomet originally designated the Idol of the Templars, used in their rituals. Supposedly they would kiss the Baphomet and do other odd things.
This idol was said to have been uncovered in Jerusalem by the Templars, who afterward re-created themselves under the name of St. John the Baptist. The thing itself is reputedly the bronzed head of John the Baptist, kept by Herod after his wife coerced him to execute St. John for his insults against their worship of Astaroth. Its eyes are set with almandine garnets.
According to legend, the Baphomet was exported and resides now somewhere in the catacombs of France. It was considered demonic by the Church, who wanted to denigrate the Templars as much as possible.
As a figure in Templar history, and the traditional association of Freemasonry with the Templars, it came into the general realm of esoteric lore. Though I assume Eliphas Levi introduced it into magical occultism specifically, Crowley adopted it as his own pseudo-masonic title in the OTO. The design on Lavey's books is actually taken from a book about the Templars.
The five-pointed star undoubtedly refers to Venus, as it does commonly in occult lore, in masonry, and even on the seal of Astaroth itself. Would the Baphomet projected on a five-pointed star then signify a binding of the spirit of St. John by the power of Astaroth?
There are also legends of the Sibyl with the brazen head that speaks oracles of Belial, similar Medieval tales, and Crowley's unpublished Ritual of the Brazen Head. These all indicate the use of a severed and bronze-preserved head that people force to give oracles through occult rituals.
--------------------
|