After Charles II of Spain died Spain was without a proper heir. Becoming king of Spain was enticing to quite a few European monarchs because of Spain’s vast territory which in turn would make that heir quite powerful.
There was a lot at stake during this period; the countries of France, England, and the Dutch had the most at stake which forced them to be very cautious around each other, because if they were not disastrous consequences would occur. The thing most at stake was Spain itself since they were without a proper heir. Thus, this was what was at stake in the war of Spanish succession.