 Complete the following phrase:  Over the next two centuries, Catalonia was generally on the losing side of a series of wars that led steadily to more centralization of power in Spain. Despite this fact, between the 16th and 18th centuries, the role of the political community in local affairs and the general government of the country was increased, while the royal powers remained relatively restricted, specially after the two last Courts 17011702 and 17051706. Tensions between the constitutional Catalan institutions and the gradually more centralized Monarchy began to arise. In 1626 the Count-Duke of Olivares, minister of Philip IV, tried to establish the military contribution of the states of the Monarchy, the Unión de Armas Union of Arms, but the resistance of Catalonia to the project was strong. This events, alongside other factors such as the economic crisis, the presence of soldiers and the peasants revolts led to the 