This is a very good topic. Does mantra works? If so how does it works?
The first that comes to my mind is, does a medicine works. Does for example paracetamol works. I am sure it does. We need not know how it works but it works.
Form what I understand, mantras are the sound representation of a particular deity ie Buddhas, Bodhisattva, protector or even worldly gods. It is the the sound energy of that particular deity. It we notice, mantra are never translated (except for understanding or as commentaries) and are always chanted in the original language, usually sanskrit or tibetan. Any modifications are very minor.
When chanted, mantras invokes the energy of that particular deity and the energy. For example, if we chant, "OM MANI PEME HUM", we invoke the sound energy of Avalokitesvara and the energy of Great Compassion. If we chant "OM A RA PA TSA NA DHI", we invoke the sound energy of Manjushri and the energy of Great Wisdom.
Another way of putting it is we create affinity with that particular deity by chanting the mantra. If we make friends with a minister of the government by calling his name often (in this case also to making friend with him in the worldly way), then when we need a favor, he is sure to help. Similarly, when we chant mantras, we are creating affinity with the deity. So, we gain the values that deity represent when chanting and also when in need we also have the protection of that deity because we have created the affinity beforehand.