Greek thērion named a wild animal. The family produced thēriakē for an antidote to a poisonous bite. Through Latin and French, English inherited a remedy word that later also named a sweet syrup.
The precise reason for the syrup extension is not certain. Resemblance and supposed medicinal qualities are proposed explanations, not a claim that syrup treats poisoning.
Sources
- Merriam-Webster: treacle
The entry documents thērion, thēriakē, the Latin/French route, the earlier remedy and modern syrup senses.
- Etymonline: treacle
The syrup-name explanation is qualified: resemblance or supposed medicinal properties are proposed.