The main purpose of the prayer is to wipe out the minor sins as well as preventing one from indulging in the major sins. It also provides a great opportunity to repent for any major sins. The Almighty says-
"Recite what has been revealed to you of the book and establish prayers. Indeed, the prayer prevents one from immorality and evil. Surely the rememberance of God is the greatest (of all actions). And God knows everything that you do."(Qur'an 29:45)