Dispersal and Retention
Written language was first disbursed by civic culture, especially trade, and later by religion. Prose became the fountain for slaking the thirst of knowledge.
Often language spread at the point of a sword. Without that, military victories were short-lived.
The yoke of arms is shaken off more readily by subject peoples than the yoke of language. ~ Italian humanist Lorenzo Valla
Languages imposed by empires have lingered or been overthrown depending upon civic and cultural dynamics. Settlers who shuck off imperial obligations retain their native tongue. This happened consistently with descendants of colonists from European empires whose foreign rule was overthrown. The revolutionists were not the indigenous people. The royalist language was their own.
Newly independent colonial countries sometimes want to retain links with their former metropolitan power because of culture, trade, or even defense. French has hung on in sub-Saharan Africa, and Spanish in the Philippines, for this reason.
Sometimes a country persists with an imperial language not because it gives a link, but instead because it provides a means to transcend the past. Russia’s elite adopted French in the 18th and 19th century. Many countries maintained or adopted English in the 20th century.