In Tibetan Buddhism, prayer flags are used to promote peace and compassion, and to generate merit and increase one's life force. It is believed that the prayers and mantras on the flags will be blown by the wind to spread good will and compassion to all beings.
You can also write names on the flags to direct the prayers to particular people or beings. According to traditional belief, because the symbols and mantras on prayer flags are sacred, they are treated with respect. They should not be placed on the ground and old prayer flags should be burned, rather than put in the rubbish.