Ah! Yes, the situation in Spain and Iberia in general. Since I am already on a roll, allow me to give another wall of text overview of how things led up to the current point in 1966 since 1936, while also once again starting with yet another rant against an element that HOI4's version of KR botched when porting an actually well thought out the well designed element over from DH...I just noticed but in KR gilbraltar is supposed to be Spanish, so why Germany took it (after WK2 I guess)
Right now, Spain is perhaps one of the least developed countries in the HOI4 version of KR. With the following meme originally shared by another user over on Reddit rightfully mocking the sheer absurdity of the way in which for a country that is even more dysfunctional compared to KR United States, having been torn apart by internal divisions and political radicalism for over a century, and have been on a decline since the Napoleonic Wars... It can somehow magically become a stable nation after a single free and fair election that everyone just somehow accepts peacefully... Even if one of the radical factions get elected, allowing either CNT-FAL or the Carlist to effortlessly enact their radical reforms in completely reshaping the country, and everyone else just sort of going along with it.
Back in the DH version of the mod, however, maintaining peace as Spain is actually a lot harder then just calling for elections and allow it to take place in good faith... In fact, acting in good faith and allowing CNT-FAL and the Carlist to legally operate openly would be one of those 'high risk, high reward' options for royalist Spain. In that they will give you bonuses in helping you overcome Black Monday much faster (With CNT-FAL organizing worker cooperatives to put the unemployed back to work building public projects and taking over mining operations; While Xavier the Carlist pretender to the throne would use his overseas contact to form an economic bloc with other Mediterranean nations to support each other through the economic crisis)... However, merely calling for open and fair elections to take place after King Alfonso suffers a stroke would not be enough. Instead, you will need to avoid having the 'Social Breakdown' event from triggering by keeping dissent level below 35 at all cost before the election takes place.... Which is almost impossible for a player to achieve even when playing on the lowest differculty, and that the AI will always fail to do. Failing to do so means that even if CNT-FAL and the Carlist were not banned from the elections, there would simply be so much chaos in the country to the point that voting cannot proceed, resulting in the Spanish Ciivl War breaking out regardless, since the radicals would have lost patience with the government, and decided that this is their best chance at seizing power for themselves.
If you as the Spanish government have acted in good faith, but failed to prevent the social breakdown before the elections, you would have utterly screwed yourself. Since not only would you have wasted all your industrial capacity in a futile attempt to keep order in the country instead of building up your own military.... As it turns out, you were the only sucker who was foolishly acting in good faith. As it would be revealed that CNT-FAL have been using their 'worker cooperatives' and 'public projects' to secretly set up fortifications, as well as have their militias infiltrate all over the country in advance; While Xavier would have used his 'Mediterranean Economic Bloc' as a smoke screen to smuggle guns and military equipment into the country from Portugal and Spain. Hence, by NOT violently cracking down on the subversives, yet failing to keep the country stable enough for elections to take place, the Spanish government would find itself in a much worst position in the Civil War compared to if they had just given up on trying to keep the peace and be dipomatic, and prepared for a fight from the start.
This would have been SUCH an interesting and cool idea to explore in HOI4's version of KR. Of it not entirely subverting and deconstructing the usual 'Peace and compromise = Good', tendencies of the mod, but make it into something that the player would have to think long and hard about like an actual political leader would. Shame that this mechanic was not ported over.
Anyway, back to the topic on how Spain ended up losing Gibraltar, and look the way it does by 1966 in TTL:
- The Spanish government acted in good faith and made a genuine effort in seeking a peaceful accommodation with both CNT-FAL and the Carlists, but failed in the end in preventing a social breakdown. Hence, once King Alfonso suffered a stroke and fell into a coma, the Spanish Civil War broke out in January 1937, two months before the Second Civil War over in America.
- Just like with the Second American Civil War, the Spainish Civil War ended up as yet another proxy conflict between the Entente (Backing the Carlist), the Reichpakt (Backing the royalist government), and the Internationale (Backing CNT-FAL), and a 'dress rehearsal' for WK2 as all sides tested out their latest weponds and doctrines in combat conditions via the side that they backed.
- During the fighting the Spanish capital of Madrid would have fallen and changed hands multiple times in the first 3 months of the conflict alone. With historical landmarks such as the Royal Palace and the Prado Museum getting utterly pillaged and burned down by one side or another (Both a reflection on something that I have observed in gameplay, as well as a deliberately subversion of OTL's 'No pasarán!' ('They shall not pass!') rallying cry for the defense of Madrid by the Republicans... By having everyone declaring 'Hemos pasado!' ('We have passed!') one point or another until it became meaningless... Since it would likely be a matter of days before another faction would be in control of the city instead.
- By the sixth month of the fighting, out of desperation, Xavier came up with devious plan: Assassinating both the still bed ridden King Alfonso and his regent, Crown Prince Juan III. Under the reasoning that this will both throw the loyalist government into chaos, as well as to clear the road for Xavier become king. And that with a true heir to the throne, the loyalist would no longer see a point in fighting, and give in to Xavier in order to stop the anarcho-syndicalists.
- The plan worked, with both the king and the crown prince slain. But instead of giving in, the loyalist merely rallied under a military junta led by General Francisco Franco, with him being declared as regent instead to continue the fight.
- However, realizing the the loyalist cause is doomed, instead of fighting it out to the bitter end, Franco made plans to set up a Spanish goverment-in-exile at the Canary Islands. Having his troop put up a desperate fighting retreat in order to buy time allowing for as many resources, materials, gold, and manpower to be evacuated to the Canaries as possible, before fully abandoning the Spanish Mainland, with both CNT-FAL and the Carlist quickly rushing in to seize the now undefended loyalist lands.
- With the retreat of the loyalist Spanish government, Germany authorized both the Moroccans and the Mittelafrikan colonial government to seize all the remaining Spanish territories in Africa.
- As for Gibraltar, the port was taken over by the CNT-FAI forces. Not waiting to see the anarcho-syndicalists controlling the means to block off the vital sea lanes allowing for passage into the Mediterranean Sea, Germany launched an special military operation to capture Gibraltar.... Their transport ships, however, were spotted by the French Communard's People's Liberation Navy, who passed on their movements to their CNT FAL comrades.
- CNT-FAL positioned a large number of veteran militia units to defend Gibraltar, supported by a few 'volunteer' elite Communard marine units with naval support. The Germans launched their operation anyway.... Only to end up getting humilated and pushed back into the sea.
- CNT-FAL emerged victorious in the Spanish Civil War, reforming the country into the 'Iberian Federation'. Sweeping the coutry in a wave of Red Terror much like the Republicans did in OTL's Spanish Civil War. With the desecration and burning of monasteries and churches, the mass killings of members of nobility, business owners, and Catholic clergy in 'Revolutionary courts', etc.