Mara is a deva from thge highest deva realm but he is often called a demon(to be clear there is an actual sentient being called Mara who is a deva and also kilesa mara which is the defilements of our own minds, he has been said to be the personification of these defilements. I have seen him being compared to as the Buddhist devil and satan before if I remember correctly. A being who wants to deter someones virtue and ultimate goal like he tried to do with the Buddha. There are other devas like Mara. So if people do black magic it would more likely to me deal with devas and not petas. Just to give more examples it is most likely devas and not those in dugati:
1) those in dugati are suffering and helpless and most likely have no magic nor power. Devas have power though.
2) In Islam black magic is done by jinns. Jinns are the closest thing to devas, similar superpowers too. There are both good jinns and bad jinns, just as there are both good or bad devas and humans. Highest jinn is Ibliss, or Islamic Satan/devil
3) in Christianity I believe black magic is done by demons. In Christianity there are good angels and bad angels. Bad ones are called fallen angels and sometimes called demonic, even Satan once the highest angel is called devil. Just as Mara is in the highest deva realm and with the most powers and also inclination to corrupt people and challenge the Buddha just like Christian Satan challenge Jesus and Islamic Satan. Just trying to point out interesting paralells to Mara in Buddhism to Christian Satan and Islamic Satan, or other Satan characters in other cultures. I’m sure someone has written a book or article on these paralells already. Point was it is most likely malevolent devas like Mara who do this.
You ask:
“Does the Buddha mention these practices”, here is a sutta relating to your topic:
Kevatta Sutta DN11
You bring up an interesting topic. I’m just wondering how does one undo black magic or break free from black magic being done by devas on the order oh humans.