What was the main reason Jesus came to Earth? Why did God take on human flesh and become a man? - We were all in need of salvation. So, Jesus, God in flesh became a man, to save us from our sins, when you come down to it, He came to forgive our sins. That was God's sole reason for sending Jesus, correct?
Now, let me set the scene. It's right after Jesus' resurrection. Jesus has died on the cross and has risen from the grave. He has concurred death! He then appears to his disciples and says, "Peace be with you. As the Father has sent me, so I send you." (John 20:21). Then Jesus did something VERY important. Something God did way back in Genesis: He breathed on them, and said "Receive the holy Spirit." (John 20:22).
So what has happened to far? We have Jesus, right after his glorious resurrection. Telling his disciples (the very first priests), he is going to send them as God has sent Him. He then breathes on them and says, "Receive the holy Spirit." You know something very important is about to happen. but what? Sacred Scripture tells us in the very next verse:
"Whose sins you forgive are forgiven them, and whose sins you retain are retained." (John 20:23)
In order for the apostles to exercise this gift of forgiving sins, the penitents must orally confess their sins to them because the apostles are not mind readers. The text makes this very clear.
Sacred Scripture tells us there is, "..one mediator between God and the human race, Christ Jesus.." (1 Tim. 2:5), As Catholics we acknowledge, Christ is the only mediator, but He was free to decide how His mediation would be applied to us. The Lord chose to use priests of God to carry out His work of forgiveness.
The Old Testament law is a shadow of the new things to come (Hebrews 10:1). What is a shadow? An outline of the actual thing! We can see that the Old Covenant, God used priests to forgive and atone for the sins of others. (Lev. 5:4-6; 19:21-22). Now we have Jesus under the New Covenant showing us the fulfillment of this by granting the authority to forgive sins to his disciples.
St. James also tells us the confession must be done orally in James 5:16. We also see this in Acts 19:18, Matt. 3:6; Mark 1:5
We have something called venial sins and mortal sins. Venial sins are minor ones, like those mentioned in 1 John 5:16-17; Luke 12:47-48, this has been the teaching of the Catholic Church for over 2,000 years, but, today, most Protestants no longer agree that there is such a distinction. Mortal sins lead to death and must be absolved in the sacrament of reconciliation. Venial sins do not have to be confessed to a priest, but the pious Catholic practice is to do so in order to advance in our journey to holiness.
Again in Matt. 5:19 Jesus teaches that breaking the least of commandments is venial sin (the person is still saved but is least in the kingdom), versus mortal sin (the person is not saved).
There is a lot more to it then this, and if you really want to understand why Catholics believe it is biblical to confess your sins to a priest, check out Scott Hahn's book: "Lord Have Mercy."