How did "you" come into play?
Originally, "thou" (T) was the only pronoun of address for the 2nd per. sing. "You" (V) - which emerged out of "ye" - was used to address more than one person. The distinction between "thou" and "you" (which developed out of "ye") was therefore simply dependent of number: "Thou" was the singular and "you" the plural.
The development of the pronouns of address in English (as part of the Indo-European language family) has to be seen in a European context. According to Brown and Gilman, the emergence of two singular pronouns of address begins with the Latin "tu" and "vos" (Brown and Gilman, "Power and Solidarity", 254). Originally there was only "tu" in the singular. This changed when, in the fourth century, the emperor was first addressed with "vos". That means that the plural form was used to address a single person as an indication of power and superiority; this usage is also called "reverential V" (Brown and Gilman, "Power and Solidarity", 256). This practice spread down the social hierarchy and was used more and more for other power figures, too. Bases for power can for example be wealth, age, sex or the institutionalized role in church or the state. "In medieval Europe generally the nobility said T to the common people and received V; the master of a household said T to his slave, his servant, and received V; parents gave T to children and were given V" (Brown and Gilman, "Power and Solidarity", 255). If we would make up a first rule , it would read: "The superior said "thou" and received "you", the inferior said "you" and received "thou" ". The reverential V was adopted by other courts in Europe.
Over time, people became more and more aware of the use of "you" as the polite form. Additionally to the dimension of power, a second dimension, which Brown and Gilman call the "dimension of solidarity" (Brown and Gilman, "Power and Solidarity", 257) emerged. A second rule could be "high solidarity rendered the use of "thou" more probable". The rules set up here will be further discussed and clarified on the basis of examples in the section When did you use which pronoun? .
In Old English the only 2nd pers. sing. pronoun was "thou". According to Finkensteadt (Finkensteadt, 49) the first definite examples for a reverential V are found in the second half of the 13th century, 200 years after the Norman Conquest. The Norman Conquest (the relevant date is the Battle of Hastings in 1066) had a significant influence on the English language. Caused by (language) contact on higher levels in society, the French practice of distinguishing between T and V was imitated by the English. In Middle English, under French influence, "you" was more and more used as "a polite or deferential singular" (Barber, 208).
Finkensteadt explains that the first known instances from spoken language date back to the beginning of the 15th century (Finkensteadt notes that by no means all sources have been researched; this restriction is especially true because Finkensteadt describes the state of research in the early 1960s. Cf. Finkensteadt, 51). As the use of "you" as pronoun of address for the 2nd per. sing. spread downwards in society and therefore was only used for small parts of the lower classes (inferior craftsmen, day labourers, country people); the importance of "thou" as a marker of emotions rose (cf. Finkensteadt, 172).
All in all you can say that the usage of "you" as 2nd pers. sing. pronoun spread as "a general concession to courtesy", until it "became the usual pronoun of direct address irrespective of rank or intimacy" (Baugh and Cable, 237).
The next section explains, why "thou" disappeared from the English language.