If you are asking for the purpose of translation to Persian, they both translate into Persian "baraye" but obviously you need to look at what comes next to translate it properly:
E.g. Por Favor is literally equivalent to English "For Favor" and Persian "Baraye marhemat/ niki" but obviously the correct meaning is "please" or "lotfan".

This question has a very complicated answer, and the complete grammar is vast in spanish as you know. Para in most of cases means "for", but sometimes Por means "for" too, please read the text below carefully, although surely it's not complete:

and in addition, there are some idioms and common expression that you will know accidentally and gradually:
por fin de semana (at the end of the week): we never say para fin de semana
por lo tanto: therefore
por lo general: generally
..........
............