“fags is an old irish term for cigarettes”
Still used today in Ireland and the UK. If in reference to a gay the normal term is poofter or a poof if being derogatory. If not being derogatory they just say gay.
A fag is a cigarette on the other side of the pond.
I Forgot to add this about the origin of the word.
“The term faggot or fagot, meaning bundle of sticks, shows up around 1300 in English. It almost certainly came from Old French, possibly going back to Greek phakelos. Since those bundles of sticks were mainly used for fires, its not surprising that the term came to mean burning sticks.”
Thus the term faggot is easily understood in relationship to cigarettes. I have no idea how it became applied to homosexuals.