All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad, sallallaahu 'alayhi wa sallam, is His slave and Messenger.
Ibn Al-Qayyim mentioned in Zaad al-Ma'aad how Hijaamah (cupping) benefits in curing magic. He said before the quote you mentioned that: “Abu 'Ubayd mentioned in his book “Ghareeb Al-Hadeeth”, with the chain of narration going back to 'Abdur-Rahmaan ibn Abu Layla, “that the Prophet had Hijaamah performed on his head when he was bewitched with magic.”
This issue has been confusing to those who are not well-versed in knowledge. They wondered how Hijaamah could be beneficial in curing magic and pondered about the connection between this disease and this remedy. If those who say this found that it is Abiqraat or Ibn Seenah who said this, then they would have accepted it without any objections, and they would say: “This has been said by those whose competence and virtue cannot be questioned.”
You should know that the magic which the Prophet was bewitched with, affected his head and one of the faculties of his head, to an extent that he would imagine that he had done something while in fact, he had not done it.
This is the behavior of the magician in nature and in the blood in a way that that matter has overtaken over the abdomen, so it has changed its mood from its original nature.” [End of quote]
What you have quoted in the question from Ibn Al-Qayyim is the view that some people had chosen with regard to the Prophet's sallallaahu 'alayhi wa sallam, having cupping performed on him, and whether or not it had anything to do with magic.
As for some cupping practitioners who say: “I have to protect myself during cupping from the evil that comes out from the patient that is being treated, by burning the gum, and performing henna on the foot and head”; then their statement is closer to superstition and illusions than to the truth.
For more benefit, please refer to Fataawa, 386323, ">92213, 15596, and 87915.
Allah knows best.