What was the cause of the War of Spanish Succession?

King Philip IV of Spain died in 1665, leaving behind only one surviving son, Charles, who became Charles II. Charles II — disfigured and mentally challenged — ascended the throne at the wee age of 4, the last of the Spanish Hapsburgs. He came to be known as El Hechizado, "The Bewitched," because it was popularly believed that his disfigurement was caused by sorcery. (It was more likely caused by generations of inbreeding.) So as not to overtax him physically or mentally, he was left totally uneducated and not even expected to keep himself clean.