Confession confers absolution because God has infinite love for us, as we are his children. However, much like a child must come to their father to confess of a mistake that they have made and be forgiven, so must we with God.
At least according to St. Augustine. This whole thing was never originally a part of Christianity until he popularized the practice in North Africa.