My question is more specifically about the 19th century but answers from before or after are fine. When for example following the February 1848 revolution in France how did French Algeria (or the other same French colonies at the time) react? Or Napoleon III's coup, the 3rd republic, etc. To me it seems that the military rule in colonies would create a more conservative politics who would oppose these revolutions but it appears that they do no become the bastions of counterrevolution. Was there large revolutionary support among the soldiers or administrators of colonies or were the revolutions not radical enough (compared to say a worker's revolution) to make the colonies accept the old government? Thank you in advance
Crisis in an Atlantic Empire by Barbara Stein and Stanley Stein is a good description of how the Napeolonic takeover of Spain affected the Spanish colonies.
Spain was originally allied with France against Britain whose naval prowess was disrupting trade between Veracruz, the primary port of New Spain (what is now Mexico), and the Spanish mainland. Spain's Prime Minister Manuel Godoy had been attempting to avoid conflict with the more powerful French and British, but after the British seized Spanish trading vessels in 1804, Godoy formed an alliance with France.
At this point, the Spanish-born elite known as peninsulares and the criollos, those born in the Americas, dominated the economic sphere of the colonies. However, neither group felt too comfortable agitating drastic change for fear that the workers or natives could ally with the other side or even grab more power for themselves. The peninsulares were fairly content with the current state of affairs and the criollos mostly wanted economic reforms that would have given them more freedom to trade with English, French or American traders instead of having to deal only with Spanish merchants.
Once Spain was aligned against Britain, Britain began blocking transatlantic traffic, especially from Veracruz, and putting pressure on the link between Spain and the colonies. The British also occupied Buenos Aires in 1806 and Montevideo in 1807. The French viceroy, Liniers, and local resistance were able to force them out, but a chain of conflict had been initiated.
Back in Europe, Spain and France signed the Treaty of Fontainebleau. Spain agreed to let French troops pass through Spain in order to invade Portugal, a British ally. The invasion was much slower and less successful than Napoleon had hoped for, and the Braganza family were able to escape to Brazil and set up court in Rio de Janeiro. Napoleon blamed the inability of the Spanish to adequately support his armies for part of the failure and began considering ways to strengthen Spain as an ally.
Godoy was becoming very unpopular in Spain, and the crown prince Fernando VII, with support from several other nobles around him, initiated a plot to remove him from power. The plot was discovered, and Fernando went on trial for sedition. His father, Carlos IV pardoned him when he divulged all of his co-conspirators, but they were then found not guilty at trial. Regardless, Carlos still banished them from Spain. As Napoleon's agents relayed the events to him, he moved away from considering either Bourbon (Carlos or Fernando) as an effective regent or ally and began planning how to enact regime change in Spain. French troops had already filled Spain and commandeered fortresses in several major cities and Napoleon could begin to apply pressure. He did not want to move too quickly though, for fear that Carlos or Godoy would think to imitate the Portuguese royals and flee to the colonies. Without the metals and revenue of the colonies, Spain would be a poor possession.
As pressure built, Fernando again moved against Godoy, this time successfully. In the Mutiny of Aranjuez, Godoy was seized and imprisoned. Carlos, who had championed Godoy as he rose through the government to eventually become Prime Minister, then abdicated in favor of Fernando. However, Carlos then also immediately communicated to the French that his abdication had occurred under duress and should not be honored.
The French were taken aback by the sudden coup, and Murat, Napoleon's brother-in-law and commander of the French armies in Spain, was unsure of how to proceed, neither blocking Fernando's path to the crown nor recognizing him officially. At this point, Fernando still believed that he could marry a Bonaparte and solidify his standing as king, but Napoleon had already decided that he was useless as an ally, and that given Fernando's previous acts of sedition, that the public of Spain might be supportive of a regime change.
Fernando was coaxed to travel to Bayonne to visit Napoleon, where he became a de facto prisoner and was asked to abdicate in favor of Napoleon. When he and his counsel refused, Carlos IV and Maria Luisa were also brought. Eventually, Fernando abdicated in favor of his favor, who then abdicated in favor of Napoleon in May 1809. A few weeks earlier, Murat had seized the presidency of the Junta de Gobierno and sent the last remaining Bourbons to Spain. After the abdication, Carlos and Maria Luisa were exiled to Rome, while Fernando and a few of his relations were held at Vallencay (Talleyrand's estate).
However, the French had miscalculated when they assumed that the Spanish would be open to regime change and that the French could step in to manage the Spanish colonies without much disruption. With the true leadership of Spain in question (even Carlota, Fernando's sister and the wife of the Portuguese regent in Brazil was putting herself forward as an interim sovereign), the criollos would often reject the existing structures and propose a new leadership, which the peninsulares in the existing bureaucracy would try to counteract. The main points of contention were the methods of involvement with the various European powers and the extent to which the peninsulares would retain control of the methods. In Rio de la Plata, where the viceroy was the Frenchman Liniers, an unsuccessful mainly-European coup was attempted and Montevideo an peninsular group withdrew recognition of the viceroy and claimed to govern instead. In Charcas, a criollo uprising in support of Fernando was followed by a mestizo insurrection in La Paz, both of which had to suppressed by troops sent by the viceroys from Lima and Buenos Aires. The insurrections were not just a monolithic block of conflicts between criollos and peninsulares. In Mexico, both groups united to suppress a mestizo uprising.
In 1810, Sevilla fell and the Junta Suprema, which had been the controlling body of the independence movement in Spain was dissolved. Although a new governing body was formed in Cadiz, the colonial administrators who had been governing "in the name of Sevilla" had lost more of their sense of legitmancy. While Spain managed to resist in Napoleon in the Peninsular War and return troops to colonies in 1814, it was too late to halt the momentum toward independence for the colonies.