John writes in the beginning of his first letter that if we confess our sins, God is faithful, and he is just, and he will forgive us these sins which we confess and cleanse us from the dark in us. This makes me think that what is implied is that by confessing our sins to God, we are forgiven. NLT says it that way, that if we confess our sins ‘to him’, we are forgiven. So, the forgiveness comes from confessing to God. James says ‘confess your sins to one another and pray for one another, that you may be healed’. I like the message there: confess to each other + pray for each other = healing.*
I like to think of these two sections as implying that forgiveness is found in confessing our sins to God, while healing is experienced by confessing our sins to one another and praying for one another, in community. The forgiveness is granted by God’s grace when we confess; the healing, God mysteriously works through our relationships with brothers and sisters.
*It may potentially be taking the verse out of context to examine it individually, as it is likely that the ‘healing’ explicitly refers to the sicknesses mentioned prior; however, in any case, it is interesting the structure which James chose, pairing confession to each other and praying for each other, leaving it possible that ‘healing’ came for both.