In the early 1600 Spain rocked the heck out of everybody. It was a powerhouse country.
By the 1700’s Spain was a second rate power.
One of the reasons for this was that Spain operated under a mercantile system. That means that they tried hard to bring as much gold into the system and prevent gold from leaving. This provides an initial expectation that the wealth of the country will go up. BUT! the real result is that if you give everyone in a country tons of cash… prices go up. It just results in huge inflation. This is the same reason why we can’t just print more money. If everyone’s a millionaire, the local bakery is going to charge a LOT more for their bread. Anyway, Spain got itself into such a bind that the only thing it could export was gold. Everything else was too expensive for other countries to buy.
In fact, Spain had so much gold they started using it in the huge wealth of churches that populated the streets. Gold structures were everywhere. The running joke at the end of the 1600’s was that Spain
had developed reverse alchemy: They figured out how to turn gold into stone.