It is used in Kabbalah, masonry, astrology, horoscopes. Hence they are forms of what was revealed through the two angels harut and marut in the city of Babil(Babylon). They only taught magic by warning people that they are a trial. So do not become disbelievers by learning it.
People in Pakistan foolishly believe in Babas and Pirs etc etc. Trust me bro I speak from personal experience. This is nothing but Black magic. They take many forms ex: Kaballah(in judaism), sufism(pirs,babas etc), spiritual healers in New Orleans(America) etc etc. But fundamentally it is pure evil satanic black magic.
They use numerology to form magic spells.
If you ever open a taweez you will most likely fidn weird number written in different boxes and grids. Such magic is especially common with Shia magicians( no offence if u r a shia. But its the evil people present in every faith).
Many people do not pay much attention to these things especially people of sub continent. But these innocent appearing babas can demolish your life completely.
Here we are talking about using numerology or ilm ul adad to delve into the realm of the ghaib i.e unseen.
Which is haraam because knowledge of ghaib is only with Allah azzawajal himself.
Except what is revealed to messengers(And I know this point is used by pirs,babas and black magicians to claim that they have special powers. But this not true).