Prayer flags are flown for different reasons including bringing about auspicious arising causes, the removal of obstacles or illness; protection against harm when traveling etc.
If we raise prayer flags, they bless the elements that touch the mantras, for example, the wind. Then, animals and insects who feel this wind are purified of their negative karma, and it transfers their consciousnesses to higher realms. Also, when rain and water touches the flags, on its way to the ground it blesses the animals, insects and worms in the ground and liberates them from the lower realms.
It is advisable to check the Tibetan calendar as to which days are auspicious for raising prayer flags and which days are considered inauspicious to do so.
The flags are usually of the 5 colors representing the five elements and arranged in a specific order, from left to right: blue, white, red, green, yellow. Blue represents the sky, white represents the air, red symbolizes fire, green symbolizes water, and yellow symbolizes earth. For specific prayers, the prayer flags may all be the same colour, for instance they may all be red.
More info about the Pharping region: https://www.rigpawiki.org/index.php?title=Pharping