For example, India had been a part of the British Empire for hundreds of years. When India became independent, did the descendants of British colonists typically return to the country of their ancestors? Or were they more likely to stay on in India?
I can't speak about the British Empire, but I can speak about the French colonial empire, and one particularly interesting example: Algeria.
While many Brits moved to the United States, South Africa, Australia, New Zealand, and Canada in the 19th century, the main destination for French immigrants was in North Africa: especially Algeria, but also Tunisia and Morocco once they were colonized. Algeria faced a particularly cataclysmic end. As an integral part of the French Republic (rather than being governed as a "colony"), many French settlers held on to the very end of the Algerian War for Independence. In 1958, a number of military officers in Algeria initiated what effectively amounts to coup d'état of the Fourth Republic and demanded the Charles de Gaulle write a new constitution with himself at the head. When he shrugged, as the war was nearing its end, more military officers got together and created the Organisation d'Armée Secrete [the Secret Army Organization], which committed bombings and assassinations in both France and Algeria. De Gaulle himself was a victim of one of these attacks.
When the war came to an end in 1962, over one million Europeans picked up their bags and moved to France. Now, this is really interesting, because in the early years of French colonization of Algeria, very few settlers were actually French. Instead, they were a mélange of French, Italians, Spanish, and Maltese. Moreover, North Africa has historically had a sizeable Jewish population, and this was just as true of Algeria as it was of Morocco and Tunisia. Under the colonial administration, Italians, Spanish, and Maltese could gain French citizenship by being settlers in Algeria. Altogether, this Mediterranean mélange came to be known as pieds-noirs, or "black feet." By 1871, the Jewish population of Algeria was also granted citizenship under the Crémieux Decrees, although this was a highly contentious affair with more settlers in Algeria opposing Jewish citizenship than supporting it.
Also notably, many of the French settlers who came to Algeria arrived from Alsace-Lorraine, which in 1871 had fallen into German hands. More still came from Corsica, and there were sizeable numbers who had their origins in heavily rural north-west of the country--they thought they could live a better lifestyle with the cheaper standard of living in Algeria, not to mention the racial hierarchy that was developed by the French colonial administration.
131 years after the colonization of Algeria began, Algeria became an independent nation. This means that settler families had deep roots in it, certainly deeper roots than my father's side of the family has in the United States [they arrived in 1921] if we're thinking temporally. Think about who in your family tree was living in 1890--that's the amount of time we're looking at, from then to the present.
Interestingly, that mélange of Mediterranean peoples I was talking about earlier, the mix of Spanish, Italians, Maltese, etc. took a different direction than you might expect. Due to their acquisition of French citizenship, their families generally moved to France, rather than their original home countries. Large proportions of the emigrés from Algeria were not actually "returning" to their home country at all, but moving someplace where they had no roots at all. This led to a great deal of disenchantment, with entire families feeling "stuck" as they did not feel they belonged in France, and they did not feel they belonged in Algeria. This is no less true of French settlers who "returned," but "arrived" in Algeria nearly a century and a half earlier. They didn't necessarily see themselves as "French" but as "Algerian" (in fact, during the colonial period, "Algerian" referred to settlers, while the people we call Algerian today were just referred to as "Arab," "Berber" (which is a different group from Algerian Arabs), and "Kabyle" (a subset of Algerian Berbers, from the Aurès Mountains in the east of the country).
A final group that I want to talk about is the "return" of Algerian Jews. Many Algerian Jews joined the "pied-noirs" in "returning" to France, although their origins were fully Algerian, not even European. However, because they had French citizenship, they could do this without legal problems, although there was (and is) cultural rejection, anti-semitism, etc. toward Algerian Jews in France. Some did move to Israel, but the bulk of the population of Tunisian and Algerian Jews moved to France. If I'm not mistaken, the same is also true of Moroccan Jews, although more substantive numbers made their way to Israel.
Geographically within France, most "returning" pieds-noirs moved to the south of the country, especially in Provence, but in adjacent regions as well. This is also interesting, as it was not the "home region" of many of the French settlers who moved to Algeria in the first place. However, Provence, and the south of France, has a climate rather similar to that of North Africa. Although the topography is different, and southern France gets more rainfall, it is far more similar to Algeria and Tunisia than anywhere else in France.
Today, you can find France's colonial archives in the sunny Provençal city of Aix-en-Provence, acting very much as a symbol of how central the Mediterranean was to French expansion overseas. The city of Aix-en-Provence is also home to the Center of Historical Documentation on Algeria, and the Algeria-Morocco-Tunisian Genealogical Association (which was created to help Europeans document their family history in North Africa, North Africans themselves were an afterthought).
I hope this answers your question--I apologize that I couldn't focus so much on the British Empire. I hope it doesn't come off that I'm defending the colonization of Algeria or Algerian settlement, I just want to make the logic behind it all accessible.
Sources:
In southern African, for the part, the White colonists generally attempted to stay, however circumstances, including distrust of Minority Rule, and a wide variety of what could be considered corrective policies designed to incentivize the emigration of white colonials and expatriates from their former colonial homes. My personal focus is largely on the Congo, however Zimbabwe (formerly Rhodesia) followed a parallel experience, and I'll be getting into that as well, to a degree. Further, my interest has largely been on the flight **from** these various countries, rather than where, specifically, they are going to.
Now, you should realize that in Southern Africa at this time, the white minority was quite small, South Africa itself, excepted (and even then, it peaked at about 19%). For instance, there were 115,000 whites in the Congo just prior to independence, in a population of about 9 million for a country the size of the whole of Western Europe by area This had followed an explosive post-war growth in the country as the Belgian government began to encourage widespread immigration to the country. In Rhodesia, later Zimbabwe, the white population numbered somewhere around 300,000, in a population of 6.9 million. Respectively, this led to populations of 1.2% white in the Congo in 1960, and 4.3% in Rhodesia by 1979 - these years being chosen due to their congruity as the first years of independence for the respective countries. Currently, there are approximately 10,000 whites in the Congo, and about 28,000 white Zimbabweans. In Mozambique, there were approximately 250,000 whites prior to independence, with the current number sitting at around 85,000, most of whom left between 1975 to 1977; though in recent years there was a small return of white populations. I would touch on South Africa's own population, however they are a rather special case, and I'm admittedly rather unfamiliar with it. Further, the most precipitous drops in the South African white population (as a percentage - there have been a general upward trend in the raw numbers) have occurred 20-25 years, putting them generally outside of the purview of r/AskHistorians.
Now, I lay all this out to make it clear to you that, simply put, in the post-independence period in southern Africa, whites were seem as a nuisance, as someone, something, to be removed from the country often through government policies upon independence designed to level the economic playing field. This was generally done through the nationalization of a variety of white-owned organizations as well as the reapportionment of the often sizeble land holdings of many white landowners in these newly independent states. While nominally, this was designed to help split up vast land holdings and to benefit the black agrarian class, in many cases these tracts of land were taken wholesale by the government and appropriated to various favorites, confidants, family members, and those with close connections to the government in question.
That said, the reactions by whites to independence during this period did vary wildly, country to country. Generally speaking, they were anti-independence. However, as things developed, they often became secessionistic (as in the case with the white population in Katanga, in the Congo), or ant-majority rule (as in the case of Rhodesia). Further,
The case of Katanga is particularly interesting in this context because they were not necessarily racially motivated, but economically so, in their support for secession from the Congo in the summer of 1960. It is true, that there were atrocities committed in Leopoldville from July 1960, by the black population, most notably soldiers of the former Force Publique, against white populations where they burned, looted, killed, and raped their way through certain districts of the city, and that these atrocities were widespread, throughout most of the country. These certainly motivated many into an anti-Lumumbist position, that is, opposition to the sitting prime minister of the Congo, Patrice Lumumba, and his government. There was widespread white flight from the major cities. The Belgians, the French, and the Americans all intervened with both regular and mercenary forces to try and restore order to the country while the United Nations was called in by Leopoldville. The American-European intervention succeeded in evacuating the vast majority of European expatriates out of the Congo. The vast majority were extracted. However, this still left plenty of white expatriates in the country, in Katanga. The white population at the time down there was estimated to be about 30,000 whites. Their motivations were many, but largely were economically and not racially motivated. Those that remained were looking to preserve their business interests for the most part. Many of them worked with, for, or through Union Minière du Haut Katanga (UMHK), the Mining Union of Upper Katanga. The secessionist leader of Katanga, Moishe Tshombe, was supported by UMHK, and many of the whites followed suit. Further, white officials were paid a handsome premium to remain in their posts, espeically in Katanga. The Congo at this time was the very model of a neocracy, with no meaningful higher educated class at the time (the country's only university, near Leopoldville had opened up only in 1954, and had only graduated a handful of students by 1960!). As such, in Katanga, while many government cabinet-level positions were filled by blacks, for many practical reasons stemming from that lack of experience, the senior bureaucracy was essentially white run. In Katanga, most senior officials in the military, the Gendarme, were white, as were the majority of the Katangan police force at this time.
As Katangan independence faltered, and the region was eventually reabsorbed into the Congo, many of these whites were replaced. By 1964, the only whites really still in power were the mercenaries that were brought in to quell the Simba uprisings. And following that, and the attempted mercenary coup in 1967 that went disastrously, there was a widespread attempt by Mobutu who was now securely in power, to nationalize and reapportion foreign investments and properties. Rubber plantations, UMHK facilities, gold and copper mines, the uranium mines, and more were largely bought out by Mobutu and then reapportioned as he saw fit into new entities that were owned by the government or by those loyal to it. Without a place, and with an increasingly hostile anti-European sentiment in the Congo with the Mobutist policies of Authenticité and Zairanization, most remaining whites fled the country. Since most were expatriates, they largely returned to their original country of residence, in most cases France or Belgium, but there were numerous Germans, Greeks, British and Americans as well amongst those fleeing (though most had largely left during the initial airlifts in 1960, or during the evacuations during the Simba uprising in 1964).
Currently there are about 10,000 white Congolese, largely of Belgian or Cypriot Greek descent (about 5,000 of each, though at one point the Greek population declined during the Second Congo War declined to just several hundred).
Mozambique was a Portuguese colony in southeastern Africa, and like Angola, had gone through a long and arduous war of Independence for the past 15 years. The end of the war only came with the collapse of the Salazar government in Portugal, and the Carnation Revolution that followed. It was actually this liberalization of Portugal, more than anything else, that saw the return of the white population to Europe in Mozambique. With liberal reforms occurring at home, they saw greater opportunities for them there, so many simply upped and left, returning home in the process. As with most of colonial Africa, there was no or minimal black educated elite to replace the whites that had left. There was a lack of qualified civil servants, doctors, etc, which threw the country into chaos. Approximately 2/3 of the white population (leaving about 80,000 in Mozambique) fled with independence, and only a fraction of those that remained took up the offer of Mozambican citizenship. Even fewer were there by the end of the 15 year Mozambican Civil War (1977-1992). While many that fled Mozambique did return to Portugal, sizable populations of white Mozambicans made for Brazil, Rhodesia, South Africa, and the United States.