How did the threefold distinction of Deacon, Priest and Bishop come about? I was reading in another question, and I've heard it said before, that in the early church (Apostolic era), there was not a clear-cut distinction between Deacon, Priest and Bishop in the sacrament of Holy Orders. So I suppose that if an apostle laid his hands on you and gave you holy orders, you became equal to the apostle in fundamental power and teaching authority. Priests were considered the equal to bishops and deacons.

Perhaps all of that is just a myth in which case please correct me with sources. If not, I'm wondering when and how (and why) the church evolved it's theology of Holy Orders such that there is the threefold distinction between Deacon, Priest and Bishop.

This is a history question, so anyone is welcome to answer. But if I absolutely must scope it down, then please keep it to the Catholic view only
The first century writing known as the Didache only mentions apostles, or missionaries. However, Paul's use of the Greek term for deacon ('servant') indicates that this office dates from the early years of Christianity. Commentators continue to debate whether the role of priest also arose during the apostolic era. Certainly, the Shepherd of Hermas talks of 'elders' -- priests -- presiding over each of the churches early in the second century, but makes no mention of bishops.

Bishops are mentioned in the Epistles to Timothy and Titus, but almost all New Testament scholars believe that these epistles were written pseudepigraphically early in the second century. The word ἐπισκόποις (overseer) is also found in Philippians 1:1, but many scholars believe that the word was not used in the sense of 'bishop' in this epistle. Philippians 1:1 also mentions Timothy, who is closely associated with the role of bishop in the two epistles that bear his name, so the verse could even have been redacted in later centuries.

Francis A. Sullivan SJ has closely examined a range of first and second century Christian writings and, from these, argues in From Apostles to Bishops that the role of bishop did not arise until the second century. He says (ibid, page 15):


  There exists a broad consensus among scholars, including most Catholic ones, that such churches as those of Alexandria, Philippi, Corinth and Rome most probably continued to be led for some time by a college of presbyters, and that only during the course of the second century did the threefold structure become generally the rule, with a bishop, assisted by presbyters, presiding over each local church.


By the end of the second century, Christian tradition held that the apostles themselves had appointed the first bishops by laying on of hands, and that bishops could only be appointed by existing bishops laying on hands, so that there is a continuous succession all the way back to the apostles themselves.