1701-1714, the second general European war related to Louis XIV's bid for French primacy. The portion of this war fought on North American soil is called Queen Anne's War.
King Carlos II of Spain was an invalid from a very young age, and it was clear that he was never to produce an heir. The issue of who would rule Spain after his death became quite contentious. The eldest son of Louis XIV had the most direct line of descent from the Spanish kings, but he was a problematic choice: the heir to the French throne. If he gained both crowns, it would amount to an annexation of Spain and her vast colonial empire by France, at a time when France was already powerful enough to threaten the European balance of power.
The alternative candidates were Archduke Charles V of Austria, and Prince Joseph Ferdinand of Bavaria. The former presented similarly formidable problems, for Charles' success would have reunited the powerful Spanish-Austrian Habsburg empire of the 16th century. As a result, Joseph Ferdinand was the favored choice of England and the Netherlands.
The War of the Grand Alliance, with essentially the same groupings of countries fighting over different issues, had come to an end just as the Spanish succession was becoming critical. War exhaustion led England and France to agree on the First Partition Treaty, which designated Joseph Ferdinand as heir, in return for which the French dauphin and Charles received territory in Italy.
Joseph Ferdinand died abruptly the next year, which led to the Second Partition Treaty. Under the terms of that agreement, Charles was to become heir, but the Italian territories that had been parcelled out amongst the two men would now go entirely to France. While France, The Netherlands, and England were all happy with the new arrangement, Austria was not and vied for the entire Spanish inheritance. While the wrangling continued, Carlos II unexpectedly spoke out and bequeathed his empire to Philip of Anjou, the grandson of Louis XIV (thus skipping over Louis' son and buying time before de facto French annexation). Louis backed out of the treaty, and the remaining interested parties acquiesced with misgivings.
Unfortunately, Louis overplayed his hand. He threatened a mercantilist policy in the Spanish/French dominions (thus cutting England and Holland off from Spanish trade) and refused to remove Philip from the line of succession to the French crown. The war began slowly, with Austrian forces under Prince Eugene of Savoy invading the Spanish territories in Italy. France soon intervened, which in turn brought in England, Holland and most of the German states. Minor powers Bavaria, Portugal, and (perversely) Savoy sided with France and Spain.
There were two main portions of the war in Europe, Spain and the territories to the north and east of France. The latter proved the more important, as Eugene and the Duke of Marlborough distinguished themselves as military commanders. At first, France was successful in Alsace, and threatened the Austrian capital, but the two generals managed to link up in Bavaria and won the Battle of Blenheim. France's trans-Rhine ambitions were crushed, and the French were forced into a defensive posture. Bavaria was knocked out of the war, and Portugal and Savoy changed sides. In Spain, the English captured Gibraltar, a possession they hold to this day.
Marlborough and Eugene split forces again, with the former going to the Netherlands, and the latter to Italy. Over the next two years, each drove the French back from those territories, with Marlborough winning the notable Battle of Ramillies. The war in Spain settled into indecisive skirmishing from which it would not emerge.
The French fought back, and managed to stall Eugene's invasion into the south of the country, and Marlborough got caught up in an endless succession of fortresses in and around Flanders. In 1708, Eugene and Marlborough once again managed to link up, and defeated the French again at the Battle of Oudenarde. An attempt to march on Paris resulted in the Battle of Malplaquet, which was won by the two generals but at such a cost to their forces that this final invasion had to be called off.
England began to get cold feet, too, as a too-decisive victory for Austria would be almost as bad for their interests as one for the French and Spanish. Marlborough fell out of grace with the English (or rather, now, British) crown for political reasons and was recalled. Peace negotiations with France led to an armistice in 1713, and 1714's Treaty of Rastatt, in which England, Holland, and France ceased fighting with one another. The Franco-Austrian hostilities lumbered on until September 1714, before the signing of the Treaty of Baden. A series of following treaties wrapped up the remaining issues, and they (collectively with Rastatt and Baden) are known as the Peace of Utrecht.
With the Peace of Utrecht, the wars to prevent French hegemony that had dominated the 17th century were over for the time being. Philip became became Spanish king, but was removed from the French succession. Louis XIV also agreed to stop supporting the Stuart claim to the throne of England. The Spanish Netherlands, Naples, and Milan were ceded to Austria; Sicily (replaced by Sardinia in 1720) was ceded to Savoy; Britain was given the exclusive right to slave trading in Spanish America; Gibraltar and Minorca were transferred from Spain to the UK; and a variety of French colonial possessions were given to Britain.