Just a century before WW1 the French under Napoleon was still fighting Great Britain how did they become allies so quickly?
This went way longer than originally meant…oops
First, this will be an attempt to tie in a vast swathe of history, so I hope that I am able to do so well and without relying on too many tropes or generalizations. Additionally, I will focus on the British reasons for the move toward France and will only brush on the French reasons.
The oft-antagonist relationship between England/Great Britain and France is an interesting one that has gone through various stages. Breaking down just what we mean by "centuries of rivalry" can better help us understand why they became Allies.
Middle Ages
The first stop in our tour is the Norman invasion. In 1066, William of Normandy, invaded England in order to secure his claim to the English throne. He had been related to the former king, Edward the Confessor, through Edward's uncle and was apparently the chosen successor. This claim was rejected by two men. Harold Hardrada, claimed the throne through his relationship to the former king Harthacnut, while Harold Godwinson had the support of the Anglo-Saxon nobility. Godwinson, who was in England had the advantage of being crowned. First, he fought off Hardrada's invasion in the north. During the preparation for that battle (Battle of Stamford Bridge), William landed in the South. When Harold G. got to the south, he waited for William at Hastings. After a hard fought battle, William had won and Harold was dead.
Hence, the first period of the conflict was one in which England was invaded by Normans (not invaded by France, but by a Lord who owed fealty to the King of France). During the next decades and centuries, England would become heavily influenced by France. In fact, some English kings would spend more time in their French holdings than in their own (See King Richard I).
This status as King of England but having lands in France for which they owed liege to the King of France created a problematic situation. Through marriage, the kings of England, by the time of Henry II, controlled Normandy, Aquitaine, Maine, Anjou, and a litany of other territories. This would lead to another outburst of cross Chanel violence.
The Hundred Years War began when the king of France, Charles IV, died and his throne was passed to Philip VI (Philip Valois) rather than Edward III of England. This was due to various ways that heir could be determined. Edward was the closest heir, but through his mother, while Philip could claim the throne through male lineage. After attempts to work out the issue, Edward pressed his claim and war broke out. Without getting into the details, the conflict raged as various kings of England and Kings of France died and were crowned. Ultimately, through a series of odd events, the French won and the English were (for the most part) kicked off of the continent.
Hence, as these two examples demonstrate, during the Middle Ages, the conflict between the English and the French were conflicts of kings (as were most conflicts of the time). They were almost entirely related to dynastic rule.
Early Modern Period
This changed during the later portions of the early modern period. The English continued to work against the French throughout the early part of this period, but never to the degree that they did in the Hundred Years War. Typically, they allied with Dutch or French Huguenots (Protestants) against the Catholic French. This was done through both financial and military support. They also entered into an alliance with the Spanish Habsburg’s while Queen Mary I, the wife of the Habsburg (Spain, Sicily, etc) king Philip II, was on the throne. The French, for their part, played a role in continuing the antagonism by interfering in English dynastic issues through their alliance with Scotland. The most famous of these is the French support of Mary, Queen of Scots, who pressed her claim to the throne of England. At the same time, the English were supporting French Huguenots during the French Religious Wars. Here we can see that the 16th century wars were both religious and dynastic. There is an interesting exception to these the Anglo-French antagonism that takes the form of the Thirty Years War. Although the English did not participate heavily in the Thirty Years War, they did give financial support to the Protestants against the Catholic Habsburgs as well as sending some troops. Charles I did this in conjunction with the Catholic French. Although limited in scope, this intervention demonstrates the beginnings of a change from English involvement in the continent being focused on dynastic interests to being focused on raison d’etat (reasons of state) such as balance of power, religion, and alliances.
During the centuries following the Thirty Years War, after the Habsburg threat subsided, the British and French began to clash again as their colonial interests conflicted. These conflicts took place both in Europe and in the American and South Asian colonies of both powers. These include such wars as The War of the Grand Alliance, The War of Spanish Succession, the War of Austrian Succession, The Seven Years War, and the U.S. War for Independence. English involvement in these conflicts revolved around two factors, European, continental balance of power and, to a lesser degree, colonial competition.
By the late 17th century, there were a few so-called Great Powers. These included Great Britain, France, and, Austria. Britain typically supported Austria against France in conflicts between the Great powers. However, this was not due to historic antagonism, but because there were fears, among many in Europe, of a hegemonic France. Great Britain, in the War of Spanish Succession, allied with Austria, Prussia, and other German states against France when the French king Louis XIV desired to make the Spanish throne Bourbon. The end result was a Bourbon Spanish monarch, gains in territories for a number of those states in the alliance, and a promise that the Spanish and French thrones would not unite.
Ultimately, although dynastic relationships continued to be a casus belli, the conflicts were primarily concerned with the Balance of Power in Europe and the primary threat to this balance was France. Hence, it is due to the nature of French supremacy, rather than historic animosity, that the British found themselves at war with France during this period. In fact, during the Seven Years War, Britain’s ally during previous wars, Austria, allied with the French. In order to restore balance, the British allied with Prussia and defeated the Franco-Austrian alliance. Again, this demonstrates that historic alliances might change for the sake of raison d’etat.