I doubt most Catholics even know the actual history of it.
Over the centuries the concrete form in which the Church has exercised this power received from the Lord has varied considerably. During the first centuries the reconciliation of Christians who had committed particularly grave sins after their Baptism (for example, idolatry, murder, or adultery) was tied to a very rigorous discipline, according to which penitents had to do public penance for their sins, often for years, before receiving reconciliation. To this order of penitents (which concerned only certain grave sins), one was only rarely admitted and in certain regions only once in a lifetime. During the seventh century Irish missionaries, inspired by the Eastern monastic tradition, took to continental Europe the private practice of penance, which does not require public and prolonged completion of penitential works before reconciliation with the Church. From that time on, the sacrament has been performed in secret between penitent and priest. This new practice envisioned the possibility of repetition and so opened the way to a regular frequenting of this sacrament. It allowed the forgiveness of grave sins and venial sins to be integrated into one sacramental celebration. In its main lines this is the form of penance that the Church has practiced down to our day (Catechism of the Catholic Church, paragraph 1447).
So, private confession was introduced a full seven centuries after Christ and His apostles. Ironically the Roman Church curses us if we dare assert the plain historical fact that secret confession to a priest was not observed from the beginning:
IOW, you have to agree with us, even contrary with the plain, clear teaching ofmmScripture. or youre going to hell.
From reading other Catholic sources, it appears that although public confession was used in the early days, it was not mandatory and that private confession had also been used since the beginning.