While on the subject of bilingualism, a third factor should be considered in addition to ability and social position. (Though I disagree that the wealthy aristocrats are necessarily the most educated in this regard---it is curious to note that during the Renaissance, the first Greek-language books were printed in Venice rather than Florence, which was host to a more sizable humanist circle and a large contingent of Byzantine intellectuals. The Venetians boasted a large seafaring and mercantile class with an extensive history in Greece and mastery of the demotic language. Or consider the Jewish domination of early medieval trans-Eurasian trade (the Radhanites); although marginalized in both Christendom and the Ummah, Jews were able to act with a degree of privileged neutrality, while western Christian and Muslim subjects were routinely prohibited entry to the domain of the other. Benjamin of Tudela is a particularly notable case of a polyglot medieval Jewish peregrine.)
This third factor is site trade relations. It is only sensible that with the movement of goods between places, there is a movement of people, language, and ideas. The more extensive and long-lasting trade relations are, the greater should be the probability that merchants and the society at large acquire facility in the language of the neighbor. Historically, such contact situations have had great effect even beyond bilingualism, sometimes dramatically restructuring the original languages. For example, Russian lost the verb meaning "to have" as an expression of possession long ago, but such a verb was introduced into Odessan Russian, which used to be spoken as a vernacular dialect in the great port city on the Black Sea, under influence from Yiddish, Romance, Turkic, etc. It's still spoken by a few elderly Jews.