I wrote something on why we confess our sins to a priest and not ‘directly to God.’
One thing I missed mentioning there is Pope Francis’ more prominent reason why we do it: to be reconciled with the Church, whom one wounds every time he or she sins.
Pope Francis’ words:
In the celebration of this Sacrament, the priest represents not only God but also the whole community, who sees itself in the weakness of each of its members, who listens and is moved by his repentance, and who is reconciled with him, which cheers him up and accompanies him on the path of conversion and human and Christian growth.
One might say: I confess only to God. Yes, you can say to God “forgive me” and say your sins, but our sins are also committed against the brethren, and against the Church. That is why it is necessary to ask pardon of the Church, and of the brethren in the person of the priest. [emphases mine]
I’ve always loved how the Holy Father makes sometimes-complex ideas seem like a crystal ball (for clarity) thrown at you (with impact).