"Baphomet" was the name that cropped up during the trials of the Knights Templar in 1307. It was described as being an Idol, a talking head, a cube of stone, and a cat, depending on whose testimony you are reading. (They were all taken by the Inquisition, under torture so this may have some bearing on the 'facts')
But the charges were Idolatry, Witchcraft, and Blasphemy. All bullshit charges laid against them by King Philip of France, who owed the Temple money. Many were burned at the stake, but a significant number escaped the Papal dissolution in 1312, and settled in Protestant Scotland, where they allegedly founded the Scottish Rite Freemasonary.
The Medieval Gnostics used an 'objet de' adoration', to represent the Fiery Body of The Holy Spirit, called Azoth, depicted as the Androgene of Mendes. This was used in the Gnostic Sabbath Rites, and it is this figure, with the addition of the Goat's head of Mendes (The Egyptian Pan) that is the Baphomet of The Templars.