The biggest legacy of Charles II of Spain, apart from being the culmination of the Habsburg incestuous comedy (yeah, I actually have a version of the Aristocrats joke which involves said family), is that he lived for far longer than expected, and his choice of heir was to spark the War of Spanish Succession.
Now suppose he, sick as he was throughout his life, dies as a child or a teenager. What could happen?