All religions use some kind of singing, chanting or reciting as part of their practice. It can help meditation, foster a sense of well-being and inspiration or aid learning, among other uses.
Chanting has been an integral part of Buddhism since its inception 2500 years ago with the Buddha; Siddartha Gautama. After the Buddhas death, at the first meeting of the Buddhist council, the monk Ananda recited in full all the sermons he had attended - and this is why all Sutras begin with "Thus I have heard". If Sutras are read, especially the early Pali language canon, such as those in the Tripitaka, they are highly repetitious, and obviously laid out in a way where the recitation is aided by the constant repeating of certain phrases. Since the Buddha was illiterate and so were most of his monks, the teachings were not physically recorded for centuries - this was also a way of protecting them from others. Regular meetings, the main ones being the Buddhist Councils were intended to ensure that the Sutras were memorised correctly by all the different groups of monks, and so avoiding errors.
A specific part of this recitation/chanting practice is the use of "Mantras". Many other religions use them, Hinduism, Islam and Christianity being examples. For example "Hail Mary" and "Our Father" as used in Catholicism are a very good parallel, the use of the Rosary mirroring the use of the Buddhist Mala. The number of recitations is usually fixed on significant numbers - for short mantras, 108 repetitions or multiples of 108 are used.
Mantras are used in the Buddhist religion in several ways. They can be used as invocations or prayers, where a specific Bodhisattva or deity is invoked for protection, or they can be used as a meditational tool. Mantras are usually short, but several common ones have 100 or 108 syllable versions. These then become more like the longer Dharanis, which are far more like "spells" - a complicated, seemingly meaningless and long series of words and syllables, often occurring at the end of a Sutra, or at the end of a chapter in a Sutra.
A mantra is often, but certainly not alway, linked to a Bodhisattva or Buddha:
Sometimes the mantra is actually linked to a concept, and the chanting is done to try and emphasise the importance of the concept:
- Gate Gate Paragate Parasamgate Bodhi Svaha - from the Heart Sutra.
- Sabbe Satta Suki Hontu - A mantra roughly meaning "may all beings be at peace". (See also this excellent node...
These mantras are chanted in groups, for example in a monastery, or can be chanted by a lone practitioner. They are designed to have a meditative effect, and when chanted out loud resonate in the chest and throat, the sensations of this increasing the effect of the practice.
The specific pronunciation of the mantra used is not vitally important. As Buddhism has spread from country to country, the pronunciation has changed, but the effects are the same - it is the devotion to the practice that is important. Most mantras do not have a specific literal meaning, and those that have are not to be thought of intellectually. The emotional and physiological effects of the devotional practice and meditation are far more important.
Mantras have become most important in two forms of Buddhism - Pure Land and Vajrayana. Vajrayana is sometimes referred to as "Mantrayana", or spell vehicle. The use of mantras and sacred syllables are a core asepect of tantric practices. In Pure Land Buddhism, highly popular in Japan, the goal is to recite the name of the Buddha called Amitabha and so become reborn in his Pure Land. Once there, the goal of enlightenment is made easier, and there is no suferring to endure while practicing. The practice of the reciting Amitabha's name is known in Japan as the Nembutsu.