All our past karma, which is our thoughts, actions and words, are stored in the universe in the form of vibration, in the form of sound, or you can say words.
Whenever you say the name of God, the pure vibration of the name of God influences the past karma which is again a vibration, a sound and changes the structure of this vibration into more pure and positive vibration. The pure vibration of the sound that you recite cleans impure vibration stored in the universe