The nature of all creation is sound vibrations. “And God said let there be light” in Genesis. Thus the smallest units of our own body-mind-spirit are sound vibrations. When we chant mantras (which are scientifically designed patterns of vibrations by great sages who knew their effects,) we attune our whole being to the divine vibrations.
Mantras are based on the Matrika, the fifty letters of the Sanskrit alphabet, each of which has a different sound. There are fifty petals/spokes on Chakras one through six. The pattern of the sounds made by chanting the mantras stimulate the different petals in different ways to ameliorate the karma of the chanter.
The mantras taught by true gurus and passed down over the millennia were first seen by ancient sages, those who had the ability to see how the patterns of energy going from one petal/spoke to another on the same or different chakras and if/how it was beneficial.
Just changing the order of the bijas on mantras can change the energy enough to become ill rather than benefited. Making up one’s own mantras is quite dangerous. As Thomas Ashley-Farrand/Namadeva Acharya often said, “Mantras are like fire. They can cook your lunch or burn down the forest.”