Baphomet was the name of a deity worshiped by the Knight’s Templars during the first crusade, his name was mentioned in transcripts but his origin and purpose was highly debatable due to the lack of historical evidence.
Baphomet’s modern image and his association with the Devil came from the French Occultist Elphas Levi, Levi reinvented Baphomet under his own drawing of the Sabbatic Goat, where he identified a winged figure with goat’s head and hooves as Baphomet. The Sabbatic Goat took over Baphomet’s original identity and now the two are inseparable in modern media.