How did Britain and France go from being at war during the time of Napoleon I to allies at the start of WW1?

by Shurtgal
Mrgoogamooga

One major push to the alliance was the unification of Germany under Bismarck. Prussia conjoining other kingdoms of the German Confederation was perceived, seemingly rightfully so, as a huge shift in the power dynamics of European politics.

Until that point, France had been viewed as the major antagonist and conquering threat to Europe due to the Napoleonic Wars, but France's humiliating defeat to Prussia in the Franco-Prussian War and loss of Alsace-Lorraine demonstrated that Germany was the resurgent power.

British Prime Minister Benjamin Disraeli acknowledged that the balance of power had fundamentally shifted. These events in the late nineteenth century would prove to be a precursor for the sort of anti-German alliance that emerged in World War I between France and the United Kingdom. Now that France was no longer the threat and Germany was, Great Britain had fewer qualms about joining with France against Germany to prevent a continental superpower forming out of German unity.

Sources:

Diplomacy by Henry Kissinger