OM, To bring peace, shanti is repeated three times at the end of the mantra. Why three times? Because there are three sources of disturbance to peace: Coming from our own body and mind. For freedom from this source of disturbance we chant the first "shanti".
Coming from the earth, from anything elemental or material outside of ourselves. This includes the environment -- everything from the physical environment (such as the weather or climate) to the political environment. For freedom from this source of disturbance we again chant "shanti".
Coming from beyond the earth, such as from spiritual factors, including our own karma. For freedom from this source of disturbance we chant a final "shanti".
om shanti shanti shanti................................om(peace)