*Louis XIV and his wars*
Louis XIV appointed marquis de Louvois, who created a professional army. However, an absolutist by nature, Louis took command himself and directly supervised all aspects of military affairs. Louvois recruited troops by dragooning (men taken off the streets), conscription, and the lottery. These soldiers were shaped into tough, obedient, military machines. The military was supported by high taxes, which eventually led to revolts in some areas of France on part of the over-taxed lower/middle classes.
Louis XIV made territorial gains in the Low Countries until his armies could not fight anymore. After William of Orange became king of England, Louis could not compete against the Bank of Amsterdam and the Bank of England.
Louis' wars left France in economic despair. Minister of finance, Le Peletier, resorted to the devaluation of currency, selling offices, tax exemptions, and nobility titles. The controller general of finance, Pontchartrain, eventually imposed the capitation, which required everybody paid taxes (so that the entire population supported war efforts). He believed that the poor would be more willing to pay taxes if the upper class men were also paying taxes.
* The War of the Spanish Succession *
King Charles II of Spain died in 1700 with no heir, posing the question, "who's going to be king?" As Gyarn says, it is (or was) a common fact that Charles was impotent.
Charles left the throne to Louis XIV's grandson Philip of Anjou. Other European powers (England, Holland, Austria, Prussia) united against France to keep Philip from taking the throne, because if he did, France could become too strong and powerful. This war was basically an issue of balance -- England and the other countries wanted to preserve the balance of power and keep French expansion (to the Americas, Asia, and Africa) in check. No one wanted one country to be too dominant.
The Peace of Utrecht ended the war. Philip remained the king of Spain, but the French and Spanish never united. The Peace of Utrecht represents the balance of power principle in operation -- it set limits on the extent to which any single power could expand.
Results -- Spain declines from its position as a great power, British Empire is expanded, French expansionist policy is ended
* Decline of absolutist Spain *
Spain had been, until this point, the leading European power, with its excellent programs of exploration and impressive income from the New world. The decline of Spain as a great power began with the defeat of the Spanish Armada by the British navy. Of course, other factors generated this downfall. Spanish lacked a middle class after the Reconquista, expulsion of Moors and Jews. Without a strong middle class, the country had a poor internal economic basis, and agricultural crisis and population decline were present. When the Treaty of Pyrenees ended the French-Spanish wars in the Thirty Years' War, Spain lost its extensive territories to France.
( Defeat of the Spanish Armada by the English Navy)
Furthermore, the Spanish-Atlantic economy decreased as other European powers (especially the English) began to participate in the Atlantic economy and settle in the New World. Spanish crown and upper class were essentially resting on their laurels (national Roman Catholic faith, military glory, economic prosperity) while the Spanish middle class failed to exist, lower class suffered, and the rest of Europe was quickly catching up to and surpassing its success.
Don Quixote is a novel mocking Spanish nobility -- obsessed with their wealth, status, and past success, the Spanish powers were blind to their downfall until it was too late.