At the beginning of the Modern Age, sixteenth century, Spanish monarchs (Catholic Monarchs, Charles I, Philip II) wanted more and more territories, power, money ... For that, they did a series of things within the country (internal politics) and outside the country (foreign policy) to improve their wealth and gain more power. They began to conquer more and more territories. They succeeded and built the "Spanish Empire". However, by the seventeenth century, it would have gotten worse.
The foreign policy of the Catholic Monarchs (the alliances of Isabella of Castile and Ferdinand of Aragon) with the European Kingdom (Habsburg) for the movement policy with Portugal-England also, conquered the land in North Africa (Melilla, Algeria, and Libya). After they defeated France, they regained the Kingdom of Naples. Finally, Christopher Columbus discovered America in 1492.
At that time of higher Habsburgs (Charles I / V of the Holy Roman Empire and Philip II). The Spanish Empire became enormous due to the inheritance, the conquest, and the exploration abroad. Carlos I inherited the Netherlands, the county of Frank and part of Central Europe of the Habsburgs and, in addition, the territories that he yearned for his mother, like America. He came to govern the western Mediterranean. Felipe II was given all those territories except Austria and Raven of the Holy Roman Empire. In addition, after the death of the King of Portugal without an heir, he inherited Portugal, along with the Portuguese territories in America, Africa, and Asia. He conquered the Philippines. As a result, their domains spread throughout the world. It was an empire in which the sun never set because it was extensive that there was always at least a part of the territory that was in daylight. Later they began to lose those territories because it was impossible to govern so much territory.
The seventeenth century was a period of agricultural crisis, wars, epidemics, and migration of peasants, which caused a demographic decline. The expulsion of Moriscos (baptized Spanish descendants of Muslims) in 1609 meant that more than 300,000 people left the peninsula. Most of them were farmers. This had a very effective agriculture, especially in Aragon and Valencia, where they were one-fifth of the population.
The Thirty Years War took place between 1618 and 1648 and was caused by conflicts between Catholics and Protestants in the Holy Roman Empire. However, it gradually became a more general conflict between the great powers in Europe for European political domination. The Peace of Westphalia put an end to the war. The main consequences of this peace treaty were the following: Spain lost its dominion over Europe and the independence of the United Provinces, the Netherlands of the North, that is to say, it stayed, the Northern Netherlands was recognized. France became the main European power and the sovereignty of the German states was recognized. Two new political models appeared: absolutism, as in France, under which the king had absolute power. This model spread through Europe and the parliamentary monarchy in England, under which the power of the monarch was restricted and the parliamentary government of the country.
Spain in the 17th Century
During the seventeenth century, the minor Habsburgs ruled Spain (Philip IV and Charles II). During this century, the Spanish monarchs fell in decline. The valid of Felipe III was the Duke Lerma, the valid of Felipe IV was the Count-Duke of Olivares, and Carlos II had valid differences because he was a minor when he came to the throne and also suffered from an illness.
Spain was bankrupt
Spain was defeated by France and Portugal gained its independence. After the death of Carlos I without an heir, there were 2 candidates for the Spanish throne, both of the Kingdom of the previous king: Philip (of Bourbon of France) and Archduke Charles (actually of the Habsburgs from Austria). They were involved in a war of dynasties, called the "War of Spanish Succession". In this war, France sided with an alliance of European power.