At the beginning of the 17th century, the situation in Castile, from where until then the men and taxes that Carlos I and Felipe II needed for their hegemonic and religious policy in Europe had come from, was no longer the same as that of the previous century.
It was exhausted, bankrupt, overwhelmed after a century of almost continuous warfare. Her population had dwindled at an alarming rate; its economy was collapsing; the fleets from the Indies that took the silver to Spain often arrived late, when they arrived, and the remittances were not what they used to be. (Joseph Perez)
Count Duke of Olivares
With this background, the Count Duke of Olivares , favorite of King Philip IV, proposed the so-called Union of Arms , which meant that all the "Kingdoms, States and Lordships" of the Hispanic Monarchy would contribute in men and money to its defense, in proportion to their population and wealth. Aware of the difficulties for them to agree to the royal proposal and that said proposal had to be approved by the Cortes of the different kingdoms, the king himself traveled to the different territories to defend his proposal. In Barcelona, for the convening of the Cortes in 1626, this letter from the king was read…
My Catalans, your count arrives at your doors attacked and irritated by his enemies, not to propose that you give him property to spend on vain gifts [...] Children, a thousand times I tell you and I repeat that not only do I not want to take away your privileges , favors and immunities […] I propose to resurrect the glory of your nation and the name that has been forgotten for so many years and that was so much terror and common opinion in Europe.
Without the possibility of reaching an agreement, the king left Barcelona. From that moment, relations between the two territories began to deteriorate. And things didn't get better...
Although previously, due to family and religious ties, Spain had already supported the Holy Roman Empire with money and soldiers during the Thirty Years' War against the Protestants, it will be in 1635 when it enters fully after the declaration of war by France (still being Catholic, in favor of Protestants). That moment will be the one that the Count-Duke of Olivares takes advantage of to recover his Union of Arms . The idea is to reinforce all the bordering territories with France and for this, troops from the different kingdoms will be sent. From Catalonia, already in full confrontation with the valid one, it is understood that they are oblivious to that war and decide not to provide the required soldiers. Given the impossibility of recruiting an army in Catalonia, the royal army, made up mostly of mercenaries, is sent to defend Catalonia. Conflicts soon arose between the soldiers of the royal army and the local population over the lodging and maintenance of the troops. Given the refusal of neighbors and towns, the soldiers committed robberies and looting. From specific confrontations, a general uprising against royal soldiers broke out in 1640.
On June 7, Corpus Christi, a small incident in Barcelona between a group of reapers, seasonal workers and some locals, in which a reaper was badly injured, turned into a revolt known as the Corpus de Sangre . The rebels took over the city for three days. The reapers were not only moved by their fury against the demands of the royal government but also against the Catalan seigniorial regime. Hatred of soldiers and royal officials became generalized against all landowners and nobles, leading to a revolt of the poor against the rich. This was, therefore, also a civil war between Catalans. This uprising, to the cry of “Long live the land, death to the bad government! ” and the death of the Viceroy of Catalonia, the Count of Santa Coloma, marked the beginning of the Reapers' War. And following the saying of "a troubled river, profit of fishermen", in December the kingdom of Portugal revolted, which will be lost definitively, and in 1641 the conspiracy of Duke Medina Sidonia to make Andalusia independent was discovered.
The situation caught Olivares by surprise, but also the Generalitat itself, which could not control the rebels and found itself in the midst of a true social revolution between the king's authority and the radicalism of his poorest subjects. Aware of their inability to reduce the revolt, -"and if they are now looking for them, it is not for greater good but for lesser evil", as a Jesuit wrote or because of what "the enemy of my enemy is my friend"- in January In 1641 a Catalan delegation met in Paris with Cardinal Richelieu …
«The King will protect, help, and favor them, wanting it to be an independent and sovereign republic, and thus has determined to receive your Majesty as Ambassadors of a free Republic, making them cover, without giving this favor, and help understand His Majesty [Louis XIII] report another interest than to ensure that the cathalans are preserved in their laws and privileges, and that they are free from oppression, and on my part I promise and assure you that I will be of value to them, and will favor them as if I were a cathalan»
Before the delegation left, the cardinal insisted that they had to be constituted as a Republic in the style of Genoa. With this agreement signed by the representatives of the Government of Catalonia and Cardinal Richelieu, Catalonia received French military support, separated from the Hispanic Monarchy and was constituted as a Free Catalan Republic under the protection of the French King Louis XIII. The free Catalan Republic lasted seven days, because, faced with the advance of Philip IV's troops, the Catalans requested more help. Now France was going to set new conditions:recognize the French king as sovereign and name him Count of Barcelona. Said and done. In this way, Catalonia found itself the battlefield of the war between France and Spain and, ironically, they passed into the situation that they had tried to avoid for so long:defray the payment of an army, which increasingly showed itself to be an occupying army, and hand over its administration to a foreign power , in this case French. With the new remittances of French soldiers, financed by the Catalans, they were able to repel the first attempt by Philip IV's troops to recapture Barcelona. Richelieu's mastery was notorious, he was a man gifted for affairs of state who, according to him, had more difficulty mastering Louis XIII's four-square-foot office — in reference to his family affairs — than the affairs of Europe. .
Richelieu
Even so, the day to day of a war, a French viceroy who favored his own - French merchants had taken over the port of Barcelona -, the economic recession, bad harvests... the population began to realize that it had been worse the remedy than the disease. With the signing of the Peace of Westphalia in 1648, which put an end to the Thirty Years' War, everything became a hand-to-hand war between France and Spain. Aware of the discontent of the Catalan population due to the French occupation, and with France less concerned about the situation in Catalonia, in 1651 Philip IV ordered the siege of Barcelona. The Franco-Catalan army of Barcelona surrendered in 1652, Felipe IV, for his part, signed obedience to the Catalan laws and was recognized as sovereign. This internal instability and its final result was harmful for Spain, but much more so for Catalonia. On the other hand, and going back to the saying that "a troubled river, fishermen profit", France took the opportunity to exploit a situation that yielded great benefits, such as the territory of Roussillon and part of Cerdanya, at practically zero cost. . And, as «Aliado» points out in a comment, in these territories the Catalan privileges were abolished and the use of a language other than French was prohibited.