Firstly, the Prayer Book ordinal's assertion that
It is evident unto all men, diligently reading holy Scripture and the ancient authors, that from the Apostles' time there have been these orders of ministers in the Christ's Church; Bishops, priests, and deaconsays about as much as can incontrovertibly asserted about the New Testament pattern of ministry. The existence of these three orders is amply attested to in Scripture. Firstly, there is the account of the Apostles setting apart the seven deacons in Acts 6. St Paul's Pastoral Epistles - 1 & 2 Timothy and Titus - contain the required qualifications for overseers - bishops; elders - Presbyters; and deacons. This demonstrates that the three orders were already an established part of Apostolic practice within 25 years of the Resurrection. However, the amount of information that we have about the roles these three orders had in the first century is pretty limited, so we have to take a quick look at extra Biblical sources including contemporary Jewish practice, and then look at the Sub-Apostolic Fathers for more detail.
That said, we are not working in a vacuum, as in many respects the Early Church had "baptized" an existing institution. First century synagogues had an 'overseer' and 'elders' who ran the affairs of the congregation, but I am afraid that I could not tell you to what degree the offices of overseer and elder overlapped with that of rabbi in the first century. This model was taken over, adapted and given an Apostolic mandate. What is very apparent though is that the ministry of Word and Sacrament rapidly became attached to these offices once the church had grown to the point where the Apostles themselves could no longer over see every congregation. By the time St Paul was writing to Titus in Crete, most Gentile Churches would have been familiar with the threefold ministry, and this pattern was to become universal by the mid-second century and remain so for some 1400 years. Writing in 1843, Christopher Wordsworth comments in 'Theophilus Anglicana' that the overwhelming major of Christians live under some sort of Episcopacy and that it is the Presbyterian and the Congregation systems that are of late invention, though he is prepared to concede that in some cases they were necessary due to the refusal of the existing hierarchies to accept reformed doctrine.
What about the functions of the three orders? How did they develop?
It seems that from very early on the fullness of the Ministry of Word and Sacrament was seen as laying with the Bishop. Bishops were the rulers of the local churches, the usual celebrant at the Eucharist, and the principle public teachers of the Faith. Presbyters exercised these functions when the Bishop was absent, or when asked to by the Bishop. The Deacons remained the 'welfare offices' of the Church, but acquired liturgical functions in that they waited on the Lord's Table, taught the youths, and prepared folks for baptism, as well as at the daily distribution to the widows and orphans of the Church. It seems that the relationship between presbyter and bishop was one of degree rather than order in some provinces of the Early Church. There is some suggestion that in both Rome and Alexandria, the Elders elected one of their own number as Bishop and set him aside for his new functions by the laying on of hands. On the other hand, in Ephesus and Antioch bishops were treated as the fundamental order, and presbyters had only certain ministries delegated to them. In the end, probably no later than 200AD, it was the Antioch pattern that won out.
As a result of this process and the increasing number and variety of heresies, the Church decided that there was a need to regulate the ordination of Bishops, by legislating that the consecration of a bishop be undertaken by several (usually three) bishops. This was to prevent one bishop, who had gone off the rails theologically, going off and ordaining a slug of new bishops and starting his own church in competition with the Catholic and Apostolic variety. On one level, this was nothing mystical, it was a 'quality control' exercise. The basic idea was that if the bishops of a province could accept as orthodox the man elected to be consecrated Bishop then the orthodoxy of the Church would be preserved. These early Canons also allowed Bishops to signify their consent in writing. The whole process was codified in the Canons of the I Council of Nicaea - along with the Canon of the New Testament. Apart from the importation of a good deal of Roman administrative machinery into the Church to help it cope with being a large scale institution, the mechanics of the ministry remained all but fixed for over a thousand years.
This was so much the case that the abandonment of Episcopacy in the Middle Ages was always an adjunct to abandoning Creedal Christianity. The Bulgars, Cathars, and Albegensians all created their own forms of ministry to replace that of the Church Catholic, and to better fit their concept of the Church being divided between the Perfecti and the Hearers. The acceptance of non-episcopal ministries by Creedally orthodox Christans is a relatively late development forced upon Martin Luther by the failure of the Bishops to accept the Reformation. Luther's solution was to effectively put the Episcopal Office into commission. The jurisdictional functions of the Bishop passed to the Prince, and the ministerial to a Consistory made up of ministers. Calvin also had to deal with this problem, he did so in a more systematic manner creating a whole system of Church Sessions and Presbyteries to administer the Reformed Church. However, both Luther and Calvin allowed Episcopacy to survive wherever it adapted to the Biblical theology of the Reformation. Scotland retained the office of Bishop alongside the Presbyteries from 1570 to about 1592, and the historic episcopate was reintroduced under the Articles of Perth in 1610. The Lutheran Church of Sweden retained the historic Episcopate, whilst the Office of Bishop survived in Denmark-Norway, and the Baltic States.
In the Church of England and the Church of Ireland, episcopacy continued because enough of the Bishops accepted the Reformation for the Historic Episcopate to continue. Matthew Parker was consecrated in 1559 by four Bishops consecrated under the old Ordinal back in the reign of Henry VIII, or just at the beginning of Edward VI's. A casual glance down the succession list will show that the Church preserved the historic Episcopate and made it a tool for maintaining Reformed doctrine in the Church of England. Early English Protestants believed that Bishops existed either for the 'well-being' (for example Jewel) of the Church, or as part of the fullness of the Church's ministry (Whitgift and Hooker.) That Episcopacy "makes" the Church was not an idea that gained much currency in the Church of England until the time of Charles I, and even then Archbishop Laud was furious when his tame historian could not "prove" the de jure divino argument. By the 1660s, most Anglicans were convinced that Episcopacy was normative, but not essential. This meant that when the Scottish Church was cut off without a shilling by William III, they made every effort to maintain Episcopal worship and ministry in Scotland, but by the same token, the Society for the Propagation of the Gospel was happy enough to use Danish Lutheran missionaries in the Church of England's missions in India.
However, whilst a spirit of cooperation remained in the mission fields of India, the situation in England was somewhat different, and a broad distinction was made between English Dissenters, and Foreign Protestants. English dissenter were regarded as not having valid ministries because they dissented from the Church of the land. Any English Presbyterian minister who conformed was therefore ordained from scratch when he came into the Church of England. On the other hand, foreign protestants were allowed to minister in the "Stranger's Churches" in London, Canterbury, and elsewhere without any objection being made by the Church of England. This was because they were the accredited representatives of their respective National Churches. However, the was largely a matter of discipline, not doctrine. It is only in the late-17th century that some High Anglicans begin to un-Church those who have no bishops. After 1689, this position was associated principally with the Non-Jurors, and "High-Fliers" like Henry Sacheverell. That said, mainstream Anglican theologians, such as Daniel Waterland, definitely had a high view of Episcopacy, though it is difficult to decide whether their views were the "plene esse" of Whitgift, or the "esse" of the more radical Caroline Divines. However, the Caroline Divines were far from uniform in their view, so, for example, John Cosin was perfectly happy to receive communion from Huguenot ministers when in exile in France.
This exclusivist tendency becomes even more marked in the 19th century with the rise of Tractarianism, and especially so in the USA where the assertive High Church Movement of the 1870s used Episcopacy de jure divino as a wedge to unprotestantize the Protestant Episcopal Church, and claim a basic identity with Roman Catholicism and Orthodoxy that negated the basically Reformed nature of Anglicanism. So extreme did this insistence on manual transmission of Episcopal Orders become that the institution of the historic episcopate became divorced from Apostolic doctrine, and an apostolic succession of hands on heads became more important than the doctrine taught. The ultimate manifestation of this peculiar understanding of Apostolic Succession is the un-churching by those who according to Scripture and the Early Fathers are no bishops of those who teach the doctrines of Scripture and the Early Church but have no bishops. This is a complete negation of the idea that an man ordained into the historic threefold ministry of the Church should be a teacher of Apostolic doctrine. In short, it is a reversal of the proper order of things which would be laughable if it were not so sad.
Anglicans adhere to Episcopacy not as an end in itself, but as a Biblical institution, However, it is not a bit of good unless the faith which is taught is that of the one Catholic and Apostolic Church as contained in those same Holy Scriptures and taught by the ancient Fathers and Councils of the Church. Furthermore, given our history, and our right to exercise commonsense, I believe that Anglicans should refrain from unchurching those who teach the Faith, but have no bishops. Episcopacy is a good thing, if it accompanies sound teaching. On the other hand, if a bishop teaches error he misleads the Church, and is the worst sort of false teacher. We need, therefore, to heed the advice of St Paul, and select as Bishops (and clergy in general) only those who 'rightly divide the word of truth.'