The great difference are the political regime.
In order to stablish the industrial revolution the country need a regime favourable to make it.
Spain and Portuguese until the Second half of XIX hadnt a parlamentary and liberal regime, in contrast, to UK (1715), France (1815) and Germany (1812).
For Germany and France, Napoleon, change their regime while UK built its parliament after civil war.
Spain, before XIX. century, had developed the textile and armament industry. The Shipbuilding was as the same level as any european country but not the mining industry. For Spain, The Napoleonic Wars, ended diferently, economically and demographicaly exhausted, while in Germany and France accepted to liberalism and parlamentarism, the country, started a civil war (parlamentarists (liberal-Centralist) vs Absolutist (Conservative-federalists)). Finally, Spain stablished parlamentary in 1878.
With the Parlamentary monarchy between 1878-1931 was established commercial alliance with UK for the Mining industry (whole north of Spain was benefit). But also started the electrical campany (Iberdrola), automotive (First, La Cuadra, Later, renamed as Hispano-Suiza), aeronautic (CASA). That period achieved the surge of Spanish Inventors but with private initiative, the politicians (corruption and bad manage) not supported enough them, provocking a slow and local devolepment. The consecuence was the disaster of 1898 (spanish-american war) and the disaster of annual (repaired by military leader expelling politicians). The spanish military caused spanish isolation. However, the military leader managed correctly, drived the economy better. (more security, more industrial companies, better infraestructure and the expansion of the railway). Even the planned the rebuilt of the Spanish Armada (5 battleships, 2 aircraft carriers and many heavy cruisers).
Again, The Crisis 1929, the exile of Alfonso XIII and the Spanish Second republic provocked a big change of economy development that favoured a bid rivalry and competitive fight between conservatives and Labourism (allied with communists), liberals in the middle were divided and broken. The left republican decided to support only the industrial companies but a great budget cut on military spending, revalry with the Church etc.. provocking a great political tension, Spain was a divided country. Another Civil War was inminent.
Franco arrived to the power in a weak situation. The majority of his supporters wanted the return of the king but he didnt wanted. His fervent supporters, the fascist, was given a great influence in a conservative dominant parliament. After, the defeat of Hitler and Mussolini, and spain in weak situation, decided to interview with the king pressured on the parliament. Franco had no option, if he wanted to continue at the power. He expelled, the fascist sector and drived a liberal-conservative government, fulled of economists. Between 1955-1975, spanish economy development increased enourmously. 4 Spanish car manufactures, 2 aeronautical companies, 4 petrol companies, Nuclear energy, Modernized the Shipbuilding, Quemistry big companies etc...
At the end, he gave back the power to the king.