Basically after the green march Juan Carlos was providing information to the CIA about Francos movements in western Sahara. The CIA has declassified this papers recently and we’re previously exposed by Wikileaks.
Supposedly Juan Carlos was betraying and providing information in exchange for the United States supporting the monarchy in the future.